@@ -175,46 +175,46 @@ public void testDelete() throws IOException {
175175
176176 public void testExists () throws IOException {
177177 {
178- GetRequest getRequest = new GetRequest ("index" , "_doc" , " id" );
178+ GetRequest getRequest = new GetRequest ("index" , "id" );
179179 assertFalse (execute (getRequest , highLevelClient ()::exists , highLevelClient ()::existsAsync ));
180180 }
181181 IndexRequest index = new IndexRequest ("index" , "_doc" , "id" );
182182 index .source ("{\" field1\" :\" value1\" ,\" field2\" :\" value2\" }" , XContentType .JSON );
183183 index .setRefreshPolicy (RefreshPolicy .IMMEDIATE );
184184 highLevelClient ().index (index , RequestOptions .DEFAULT );
185185 {
186- GetRequest getRequest = new GetRequest ("index" , "_doc" , " id" );
186+ GetRequest getRequest = new GetRequest ("index" , "id" );
187187 assertTrue (execute (getRequest , highLevelClient ()::exists , highLevelClient ()::existsAsync ));
188188 }
189189 {
190- GetRequest getRequest = new GetRequest ("index" , "_doc" , " does_not_exist" );
190+ GetRequest getRequest = new GetRequest ("index" , "does_not_exist" );
191191 assertFalse (execute (getRequest , highLevelClient ()::exists , highLevelClient ()::existsAsync ));
192192 }
193193 {
194- GetRequest getRequest = new GetRequest ("index" , "_doc" , " does_not_exist" ).version (1 );
194+ GetRequest getRequest = new GetRequest ("index" , "does_not_exist" ).version (1 );
195195 assertFalse (execute (getRequest , highLevelClient ()::exists , highLevelClient ()::existsAsync ));
196196 }
197197 }
198198
199199 public void testSourceExists () throws IOException {
200200 {
201- GetRequest getRequest = new GetRequest ("index" , "_doc" , " id" );
201+ GetRequest getRequest = new GetRequest ("index" , "id" );
202202 assertFalse (execute (getRequest , highLevelClient ()::existsSource , highLevelClient ()::existsSourceAsync ));
203203 }
204204 IndexRequest index = new IndexRequest ("index" , "_doc" , "id" );
205205 index .source ("{\" field1\" :\" value1\" ,\" field2\" :\" value2\" }" , XContentType .JSON );
206206 index .setRefreshPolicy (RefreshPolicy .IMMEDIATE );
207207 highLevelClient ().index (index , RequestOptions .DEFAULT );
208208 {
209- GetRequest getRequest = new GetRequest ("index" , "_doc" , " id" );
209+ GetRequest getRequest = new GetRequest ("index" , "id" );
210210 assertTrue (execute (getRequest , highLevelClient ()::existsSource , highLevelClient ()::existsSourceAsync ));
211211 }
212212 {
213- GetRequest getRequest = new GetRequest ("index" , "_doc" , " does_not_exist" );
213+ GetRequest getRequest = new GetRequest ("index" , "does_not_exist" );
214214 assertFalse (execute (getRequest , highLevelClient ()::existsSource , highLevelClient ()::existsSourceAsync ));
215215 }
216216 {
217- GetRequest getRequest = new GetRequest ("index" , "_doc" , " does_not_exist" ).version (1 );
217+ GetRequest getRequest = new GetRequest ("index" , "does_not_exist" ).version (1 );
218218 assertFalse (execute (getRequest , highLevelClient ()::existsSource , highLevelClient ()::existsSourceAsync ));
219219 }
220220 }
@@ -245,15 +245,15 @@ public void testSourceDoesNotExist() throws IOException {
245245 );
246246 }
247247 {
248- GetRequest getRequest = new GetRequest (noSourceIndex , "_doc" , " 1" );
248+ GetRequest getRequest = new GetRequest (noSourceIndex , "1" );
249249 assertTrue (execute (getRequest , highLevelClient ()::exists , highLevelClient ()::existsAsync ));
250250 assertFalse (execute (getRequest , highLevelClient ()::existsSource , highLevelClient ()::existsSourceAsync ));
251251 }
252252 }
253253
254254 public void testGet () throws IOException {
255255 {
256- GetRequest getRequest = new GetRequest ("index" , "_doc" , " id" );
256+ GetRequest getRequest = new GetRequest ("index" , "id" );
257257 ElasticsearchException exception = expectThrows (ElasticsearchException .class ,
258258 () -> execute (getRequest , highLevelClient ()::get , highLevelClient ()::getAsync ));
259259 assertEquals (RestStatus .NOT_FOUND , exception .status ());
@@ -266,7 +266,7 @@ public void testGet() throws IOException {
266266 index .setRefreshPolicy (RefreshPolicy .IMMEDIATE );
267267 highLevelClient ().index (index , RequestOptions .DEFAULT );
268268 {
269- GetRequest getRequest = new GetRequest ("index" , "_doc" , " id" ).version (2 );
269+ GetRequest getRequest = new GetRequest ("index" , "id" ).version (2 );
270270 ElasticsearchException exception = expectThrows (ElasticsearchException .class ,
271271 () -> execute (getRequest , highLevelClient ()::get , highLevelClient ()::getAsync ));
272272 assertEquals (RestStatus .CONFLICT , exception .status ());
@@ -275,7 +275,7 @@ public void testGet() throws IOException {
275275 assertEquals ("index" , exception .getMetadata ("es.index" ).get (0 ));
276276 }
277277 {
278- GetRequest getRequest = new GetRequest ("index" , "_doc" , " id" );
278+ GetRequest getRequest = new GetRequest ("index" , "id" );
279279 if (randomBoolean ()) {
280280 getRequest .version (1L );
281281 }
@@ -289,7 +289,7 @@ public void testGet() throws IOException {
289289 assertEquals (document , getResponse .getSourceAsString ());
290290 }
291291 {
292- GetRequest getRequest = new GetRequest ("index" , "_doc" , " does_not_exist" );
292+ GetRequest getRequest = new GetRequest ("index" , "does_not_exist" );
293293 GetResponse getResponse = execute (getRequest , highLevelClient ()::get , highLevelClient ()::getAsync );
294294 assertEquals ("index" , getResponse .getIndex ());
295295 assertEquals ("_doc" , getResponse .getType ());
@@ -300,7 +300,7 @@ public void testGet() throws IOException {
300300 assertNull (getResponse .getSourceAsString ());
301301 }
302302 {
303- GetRequest getRequest = new GetRequest ("index" , "_doc" , " id" );
303+ GetRequest getRequest = new GetRequest ("index" , "id" );
304304 getRequest .fetchSourceContext (new FetchSourceContext (false , Strings .EMPTY_ARRAY , Strings .EMPTY_ARRAY ));
305305 GetResponse getResponse = execute (getRequest , highLevelClient ()::get , highLevelClient ()::getAsync );
306306 assertEquals ("index" , getResponse .getIndex ());
@@ -312,7 +312,7 @@ public void testGet() throws IOException {
312312 assertNull (getResponse .getSourceAsString ());
313313 }
314314 {
315- GetRequest getRequest = new GetRequest ("index" , "_doc" , " id" );
315+ GetRequest getRequest = new GetRequest ("index" , "id" );
316316 if (randomBoolean ()) {
317317 getRequest .fetchSourceContext (new FetchSourceContext (true , new String []{"field1" }, Strings .EMPTY_ARRAY ));
318318 } else {
@@ -334,23 +334,23 @@ public void testGet() throws IOException {
334334 public void testMultiGet () throws IOException {
335335 {
336336 MultiGetRequest multiGetRequest = new MultiGetRequest ();
337- multiGetRequest .add ("index" , "_doc" , " id1" );
338- multiGetRequest .add ("index" , "_doc" , " id2" );
337+ multiGetRequest .add ("index" , "id1" );
338+ multiGetRequest .add ("index" , "id2" );
339339 MultiGetResponse response = execute (multiGetRequest , highLevelClient ()::mget , highLevelClient ()::mgetAsync );
340340 assertEquals (2 , response .getResponses ().length );
341341
342342 assertTrue (response .getResponses ()[0 ].isFailed ());
343343 assertNull (response .getResponses ()[0 ].getResponse ());
344344 assertEquals ("id1" , response .getResponses ()[0 ].getFailure ().getId ());
345- assertEquals ( "_doc" , response .getResponses ()[0 ].getFailure ().getType ());
345+ assertNull ( response .getResponses ()[0 ].getFailure ().getType ());
346346 assertEquals ("index" , response .getResponses ()[0 ].getFailure ().getIndex ());
347347 assertEquals ("Elasticsearch exception [type=index_not_found_exception, reason=no such index [index]]" ,
348348 response .getResponses ()[0 ].getFailure ().getFailure ().getMessage ());
349349
350350 assertTrue (response .getResponses ()[1 ].isFailed ());
351351 assertNull (response .getResponses ()[1 ].getResponse ());
352352 assertEquals ("id2" , response .getResponses ()[1 ].getId ());
353- assertEquals ( "_doc" , response .getResponses ()[1 ].getType ());
353+ assertNull ( response .getResponses ()[1 ].getType ());
354354 assertEquals ("index" , response .getResponses ()[1 ].getIndex ());
355355 assertEquals ("Elasticsearch exception [type=index_not_found_exception, reason=no such index [index]]" ,
356356 response .getResponses ()[1 ].getFailure ().getFailure ().getMessage ());
@@ -366,8 +366,8 @@ public void testMultiGet() throws IOException {
366366 highLevelClient ().bulk (bulk , RequestOptions .DEFAULT );
367367 {
368368 MultiGetRequest multiGetRequest = new MultiGetRequest ();
369- multiGetRequest .add ("index" , "_doc" , " id1" );
370- multiGetRequest .add ("index" , "_doc" , " id2" );
369+ multiGetRequest .add ("index" , "id1" );
370+ multiGetRequest .add ("index" , "id2" );
371371 MultiGetResponse response = execute (multiGetRequest , highLevelClient ()::mget , highLevelClient ()::mgetAsync );
372372 assertEquals (2 , response .getResponses ().length );
373373
@@ -789,7 +789,7 @@ public void testUpdateByQuery() throws Exception {
789789 assertEquals (0 , bulkResponse .getSearchFailures ().size ());
790790 assertEquals (
791791 3 ,
792- (int ) (highLevelClient ().get (new GetRequest (sourceIndex , "_doc" , " 2" ), RequestOptions .DEFAULT )
792+ (int ) (highLevelClient ().get (new GetRequest (sourceIndex , "2" ), RequestOptions .DEFAULT )
793793 .getSourceAsMap ().get ("foo" ))
794794 );
795795 }
@@ -1059,7 +1059,7 @@ public void testUrlEncode() throws IOException {
10591059 assertEquals ("id#1" , indexResponse .getId ());
10601060 }
10611061 {
1062- GetRequest getRequest = new GetRequest (indexPattern , "_doc" , " id#1" );
1062+ GetRequest getRequest = new GetRequest (indexPattern , "id#1" );
10631063 GetResponse getResponse = highLevelClient ().get (getRequest , RequestOptions .DEFAULT );
10641064 assertTrue (getResponse .isExists ());
10651065 assertEquals (expectedIndex , getResponse .getIndex ());
@@ -1077,7 +1077,7 @@ public void testUrlEncode() throws IOException {
10771077 assertEquals (docId , indexResponse .getId ());
10781078 }
10791079 {
1080- GetRequest getRequest = new GetRequest ("index" , "_doc" , docId );
1080+ GetRequest getRequest = new GetRequest ("index" , docId );
10811081 GetResponse getResponse = highLevelClient ().get (getRequest , RequestOptions .DEFAULT );
10821082 assertTrue (getResponse .isExists ());
10831083 assertEquals ("index" , getResponse .getIndex ());
@@ -1101,7 +1101,7 @@ public void testParamsEncode() throws IOException {
11011101 assertEquals ("id" , indexResponse .getId ());
11021102 }
11031103 {
1104- GetRequest getRequest = new GetRequest ("index" , "_doc" , " id" ).routing (routing );
1104+ GetRequest getRequest = new GetRequest ("index" , "id" ).routing (routing );
11051105 GetResponse getResponse = highLevelClient ().get (getRequest , RequestOptions .DEFAULT );
11061106 assertTrue (getResponse .isExists ());
11071107 assertEquals ("index" , getResponse .getIndex ());
0 commit comments