浏览代码

Remove type field from DocWriteRequest and associated Response objects (#47671)

This commit removes the type field from index, update and delete requests, and their
associated responses.

Relates to #41059
Alan Woodward 6 年之前
父节点
当前提交
566e1b7d33
共有 100 个文件被更改,包括 113 次插入1527 次删除
  1. 1 1
      client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java
  2. 1 1
      client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/TransportNoopBulkAction.java
  3. 4 14
      client/rest-high-level/src/main/java/org/elasticsearch/client/RequestConverters.java
  4. 6 12
      client/rest-high-level/src/test/java/org/elasticsearch/client/BulkProcessorIT.java
  5. 1 1
      client/rest-high-level/src/test/java/org/elasticsearch/client/CCRIT.java
  6. 1 89
      client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java
  7. 3 3
      client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java
  8. 0 76
      client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java
  9. 5 11
      client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java
  10. 8 8
      client/rest-high-level/src/test/java/org/elasticsearch/client/TasksIT.java
  11. 8 8
      client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/MlClientDocumentationIT.java
  12. 1 1
      distribution/archives/integ-test-zip/src/test/java/org/elasticsearch/test/rest/RequestsWithoutContentIT.java
  13. 3 3
      docs/reference/aggregations/bucket/autodatehistogram-aggregation.asciidoc
  14. 3 3
      docs/reference/api-conventions.asciidoc
  15. 1 1
      docs/reference/cat/count.asciidoc
  16. 1 1
      docs/reference/cat/segments.asciidoc
  17. 1 5
      docs/reference/docs/bulk.asciidoc
  18. 0 1
      docs/reference/docs/concurrency-control.asciidoc
  19. 0 1
      docs/reference/docs/delete.asciidoc
  20. 0 2
      docs/reference/docs/index_.asciidoc
  21. 1 1
      docs/reference/docs/reindex.asciidoc
  22. 0 1
      docs/reference/docs/update.asciidoc
  23. 0 1
      docs/reference/getting-started.asciidoc
  24. 0 1
      docs/reference/indices/rollover-index.asciidoc
  25. 2 2
      docs/reference/indices/segments.asciidoc
  26. 1 1
      docs/reference/indices/shard-stores.asciidoc
  27. 0 1
      docs/reference/ingest.asciidoc
  28. 0 8
      docs/reference/ingest/apis/simulate-pipeline.asciidoc
  29. 0 1
      docs/reference/ingest/ingest-node.asciidoc
  30. 0 2
      docs/reference/ingest/processors/date-index-name.asciidoc
  31. 0 2
      docs/reference/ingest/processors/grok.asciidoc
  32. 0 1
      docs/reference/ingest/processors/pipeline.asciidoc
  33. 3 5
      docs/reference/ingest/processors/script.asciidoc
  34. 0 1
      docs/reference/ingest/processors/set.asciidoc
  35. 0 40
      docs/reference/mapping/removal_of_types.asciidoc
  36. 0 1
      docs/reference/query-dsl/percolate-query.asciidoc
  37. 6 6
      modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/DateIndexNameProcessorTests.java
  38. 4 4
      modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/DissectProcessorTests.java
  39. 9 12
      modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ForEachProcessorTests.java
  40. 2 2
      modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpProcessorFactoryTests.java
  41. 1 1
      modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpProcessorNonIngestNodeTests.java
  42. 0 4
      modules/lang-painless/src/test/resources/rest-api-spec/test/painless/15_update.yml
  43. 0 2
      modules/mapper-extras/src/test/resources/rest-api-spec/test/search-as-you-type/10_basic.yml
  44. 0 1
      modules/mapper-extras/src/test/resources/rest-api-spec/test/search-as-you-type/20_highlighting.yml
  45. 3 5
      modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java
  46. 5 5
      modules/reindex/src/test/java/org/elasticsearch/index/reindex/CancelTests.java
  47. 0 22
      modules/reindex/src/test/java/org/elasticsearch/index/reindex/RestReindexActionTests.java
  48. 0 2
      modules/reindex/src/test/resources/rest-api-spec/test/delete_by_query/10_basic.yml
  49. 0 2
      modules/reindex/src/test/resources/rest-api-spec/test/update_by_query/10_basic.yml
  50. 1 3
      qa/mixed-cluster/src/test/java/org/elasticsearch/backwards/IndexingIT.java
  51. 1 1
      qa/os/bats/default/bootstrap_password.bash
  52. 1 1
      qa/os/bats/default/certgen.bash
  53. 9 9
      qa/os/bats/upgrade/80_upgrade.bats
  54. 2 2
      qa/os/bats/utils/utils.bash
  55. 2 2
      qa/os/src/test/java/org/elasticsearch/packaging/util/ServerUtils.java
  56. 3 5
      qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RecoveryIT.java
  57. 0 1
      qa/smoke-test-ingest-disabled/src/test/resources/rest-api-spec/test/ingest_mustache/10_ingest_disabled.yml
  58. 4 4
      qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/ingest/IngestDocumentMustacheIT.java
  59. 1 1
      qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/ingest/ValueSourceMustacheIT.java
  60. 4 10
      qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/10_pipeline_with_mustache_templates.yml
  61. 0 2
      qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/20_combine_processors.yml
  62. 0 1
      qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/30_update_by_query_with_ingest.yml
  63. 0 1
      qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/40_reindex_with_ingest.yml
  64. 0 2
      qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/50_script_processor_using_painless.yml
  65. 0 47
      rest-api-spec/src/main/resources/rest-api-spec/api/index.json
  66. 0 31
      rest-api-spec/src/main/resources/rest-api-spec/test/create/11_with_id_with_types.yml
  67. 0 8
      rest-api-spec/src/main/resources/rest-api-spec/test/create/15_without_id_with_types.yml
  68. 0 30
      rest-api-spec/src/main/resources/rest-api-spec/test/create/36_external_version_with_types.yml
  69. 0 41
      rest-api-spec/src/main/resources/rest-api-spec/test/create/41_routing_with_types.yml
  70. 0 82
      rest-api-spec/src/main/resources/rest-api-spec/test/create/61_refresh_with_types.yml
  71. 0 38
      rest-api-spec/src/main/resources/rest-api-spec/test/create/71_nested_with_types.yml
  72. 0 1
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/11_shard_header.yml
  73. 0 19
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/13_basic_with_types.yml
  74. 0 36
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml
  75. 0 26
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/15_result_with_types.yml
  76. 0 30
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/21_cas_with_types.yml
  77. 0 32
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/27_external_version_with_types.yml
  78. 0 53
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml
  79. 0 32
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/31_routing_with_types.yml
  80. 0 148
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/51_refresh_with_types.yml
  81. 0 19
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/61_missing_with_types.yml
  82. 0 30
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml
  83. 0 1
      rest-api-spec/src/main/resources/rest-api-spec/test/index/10_with_id.yml
  84. 0 32
      rest-api-spec/src/main/resources/rest-api-spec/test/index/11_with_id_with_types.yml
  85. 0 21
      rest-api-spec/src/main/resources/rest-api-spec/test/index/13_result_with_types.yml
  86. 0 1
      rest-api-spec/src/main/resources/rest-api-spec/test/index/15_without_id.yml
  87. 0 24
      rest-api-spec/src/main/resources/rest-api-spec/test/index/16_without_id_with_types.yml
  88. 0 29
      rest-api-spec/src/main/resources/rest-api-spec/test/index/21_optype_with_types.yml
  89. 0 55
      rest-api-spec/src/main/resources/rest-api-spec/test/index/37_external_version_with_types.yml
  90. 0 56
      rest-api-spec/src/main/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml
  91. 0 41
      rest-api-spec/src/main/resources/rest-api-spec/test/index/41_routing_with_types.yml
  92. 0 83
      rest-api-spec/src/main/resources/rest-api-spec/test/index/61_refresh_with_types.yml
  93. 0 1
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.flush/10_basic.yml
  94. 0 2
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml
  95. 0 2
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml
  96. 0 1
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml
  97. 0 44
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml
  98. 0 2
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.segments/10_basic.yml
  99. 0 3
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml
  100. 0 2
      rest-api-spec/src/main/resources/rest-api-spec/test/search/300_sequence_numbers.yml

+ 1 - 1
client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java

@@ -82,7 +82,7 @@ public class RestNoopBulkAction extends BaseRestHandler {
 
     private static class BulkRestBuilderListener extends RestBuilderListener<BulkRequest> {
         private final BulkItemResponse ITEM_RESPONSE = new BulkItemResponse(1, DocWriteRequest.OpType.UPDATE,
-            new UpdateResponse(new ShardId("mock", "", 1), "mock_type", "1", 0L, 1L, 1L, DocWriteResponse.Result.CREATED));
+            new UpdateResponse(new ShardId("mock", "", 1), "1", 0L, 1L, 1L, DocWriteResponse.Result.CREATED));
 
         private final RestRequest request;
 

+ 1 - 1
client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/TransportNoopBulkAction.java

@@ -34,7 +34,7 @@ import org.elasticsearch.transport.TransportService;
 
 public class TransportNoopBulkAction extends HandledTransportAction<BulkRequest, BulkResponse> {
     private static final BulkItemResponse ITEM_RESPONSE = new BulkItemResponse(1, DocWriteRequest.OpType.UPDATE,
-        new UpdateResponse(new ShardId("mock", "", 1), "mock_type", "1", 0L, 1L, 1L, DocWriteResponse.Result.CREATED));
+        new UpdateResponse(new ShardId("mock", "", 1), "1", 0L, 1L, 1L, DocWriteResponse.Result.CREATED));
 
     @Inject
     public TransportNoopBulkAction(TransportService transportService, ActionFilters actionFilters) {

+ 4 - 14
client/rest-high-level/src/main/java/org/elasticsearch/client/RequestConverters.java

@@ -70,7 +70,6 @@ import org.elasticsearch.common.xcontent.XContentHelper;
 import org.elasticsearch.common.xcontent.XContentParser;
 import org.elasticsearch.common.xcontent.XContentType;
 import org.elasticsearch.index.VersionType;
-import org.elasticsearch.index.mapper.MapperService;
 import org.elasticsearch.index.rankeval.RankEvalRequest;
 import org.elasticsearch.index.reindex.AbstractBulkByScrollRequest;
 import org.elasticsearch.index.reindex.DeleteByQueryRequest;
@@ -102,7 +101,7 @@ final class RequestConverters {
     }
 
     static Request delete(DeleteRequest deleteRequest) {
-        String endpoint = endpoint(deleteRequest.index(), deleteRequest.type(), deleteRequest.id());
+        String endpoint = endpoint(deleteRequest.index(), deleteRequest.id());
         Request request = new Request(HttpDelete.METHOD_NAME, endpoint);
 
         Params parameters = new Params();
@@ -170,11 +169,6 @@ final class RequestConverters {
                     if (Strings.hasLength(action.index())) {
                         metadata.field("_index", action.index());
                     }
-                    if (Strings.hasLength(action.type())) {
-                        if (MapperService.SINGLE_MAPPING_NAME.equals(action.type()) == false) {
-                            metadata.field("_type", action.type());
-                        }
-                    }
                     if (Strings.hasLength(action.id())) {
                         metadata.field("_id", action.id());
                     }
@@ -309,11 +303,9 @@ final class RequestConverters {
 
         String endpoint;
         if (indexRequest.opType() == DocWriteRequest.OpType.CREATE) {
-            endpoint = indexRequest.type().equals(MapperService.SINGLE_MAPPING_NAME)
-                ? endpoint(indexRequest.index(), "_create", indexRequest.id())
-                : endpoint(indexRequest.index(), indexRequest.type(), indexRequest.id(), "_create");
+            endpoint = endpoint(indexRequest.index(), "_create", indexRequest.id());
         } else {
-            endpoint = endpoint(indexRequest.index(), indexRequest.type(), indexRequest.id());
+            endpoint = endpoint(indexRequest.index(), indexRequest.id());
         }
 
         Request request = new Request(method, endpoint);
@@ -341,9 +333,7 @@ final class RequestConverters {
     }
 
     static Request update(UpdateRequest updateRequest) throws IOException {
-        String endpoint = updateRequest.type().equals(MapperService.SINGLE_MAPPING_NAME)
-            ? endpoint(updateRequest.index(), "_update", updateRequest.id())
-            : endpoint(updateRequest.index(), updateRequest.type(), updateRequest.id(), "_update");
+        String endpoint = endpoint(updateRequest.index(), "_update", updateRequest.id());
         Request request = new Request(HttpPost.METHOD_NAME, endpoint);
 
         Params parameters = new Params();

+ 6 - 12
client/rest-high-level/src/test/java/org/elasticsearch/client/BulkProcessorIT.java

@@ -320,8 +320,6 @@ public class BulkProcessorIT extends ESRestHighLevelClientTestCase {
         {
             final CountDownLatch latch = new CountDownLatch(1);
             BulkProcessorTestListener listener = new BulkProcessorTestListener(latch);
-            //Check that untyped document additions inherit the global type
-            String localType = null;
             try (BulkProcessor processor = initBulkProcessorBuilder(listener)
                     //let's make sure that the bulk action limit trips, one single execution will index all the documents
                     .setConcurrentRequests(randomIntBetween(0, 1)).setBulkActions(numDocs)
@@ -331,7 +329,7 @@ public class BulkProcessorIT extends ESRestHighLevelClientTestCase {
                     .setGlobalPipeline("pipeline_id")
                     .build()) {
 
-                indexDocs(processor, numDocs, null, localType, "test", "pipeline_id");
+                indexDocs(processor, numDocs, null, "test", "pipeline_id");
                 latch.await();
 
                 assertThat(listener.beforeCounts.get(), equalTo(1));
@@ -356,15 +354,15 @@ public class BulkProcessorIT extends ESRestHighLevelClientTestCase {
             .<Matcher<SearchHit>>toArray(Matcher[]::new);
     }
 
-    private MultiGetRequest indexDocs(BulkProcessor processor, int numDocs, String localIndex, String localType,
+    private MultiGetRequest indexDocs(BulkProcessor processor, int numDocs, String localIndex,
                                       String globalIndex, String globalPipeline) throws Exception {
         MultiGetRequest multiGetRequest = new MultiGetRequest();
         for (int i = 1; i <= numDocs; i++) {
             if (randomBoolean()) {
-                processor.add(new IndexRequest(localIndex, localType, Integer.toString(i))
+                processor.add(new IndexRequest(localIndex).id(Integer.toString(i))
                     .source(XContentType.JSON, "field", randomRealisticUnicodeOfLengthBetween(1, 30)));
             } else {
-                BytesArray data = bytesBulkRequest(localIndex, localType, i);
+                BytesArray data = bytesBulkRequest(localIndex, i);
                 processor.add(data, globalIndex, globalPipeline, XContentType.JSON);
             }
             multiGetRequest.add(localIndex, Integer.toString(i));
@@ -372,17 +370,13 @@ public class BulkProcessorIT extends ESRestHighLevelClientTestCase {
         return multiGetRequest;
     }
 
-    private static BytesArray bytesBulkRequest(String localIndex, String localType, int id) throws IOException {
+    private static BytesArray bytesBulkRequest(String localIndex, int id) throws IOException {
         XContentBuilder action = jsonBuilder().startObject().startObject("index");
 
         if (localIndex != null) {
             action.field("_index", localIndex);
         }
 
-        if (localType != null) {
-            action.field("_type", localType);
-        }
-
         action.field("_id", Integer.toString(id));
         action.endObject().endObject();
 
@@ -396,7 +390,7 @@ public class BulkProcessorIT extends ESRestHighLevelClientTestCase {
     }
 
     private MultiGetRequest indexDocs(BulkProcessor processor, int numDocs) throws Exception {
-        return indexDocs(processor, numDocs, "test", null, null, null);
+        return indexDocs(processor, numDocs, "test", null, null);
     }
 
     private static void assertResponseItems(List<BulkItemResponse> bulkItemResponses, int numDocs) {

+ 1 - 1
client/rest-high-level/src/test/java/org/elasticsearch/client/CCRIT.java

@@ -111,7 +111,7 @@ public class CCRIT extends ESRestHighLevelClientTestCase {
         assertThat(putFollowResponse.isFollowIndexShardsAcked(), is(true));
         assertThat(putFollowResponse.isIndexFollowingStarted(), is(true));
 
-        IndexRequest indexRequest = new IndexRequest("leader", "_doc")
+        IndexRequest indexRequest = new IndexRequest("leader")
             .setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE)
             .source("{}", XContentType.JSON);
         highLevelClient().index(indexRequest, RequestOptions.DEFAULT);

+ 1 - 89
client/rest-high-level/src/test/java/org/elasticsearch/client/CrudIT.java

@@ -54,9 +54,6 @@ import org.elasticsearch.common.xcontent.XContentType;
 import org.elasticsearch.index.VersionType;
 import org.elasticsearch.index.get.GetResult;
 import org.elasticsearch.rest.RestStatus;
-import org.elasticsearch.rest.action.document.RestDeleteAction;
-import org.elasticsearch.rest.action.document.RestIndexAction;
-import org.elasticsearch.rest.action.document.RestUpdateAction;
 import org.elasticsearch.script.Script;
 import org.elasticsearch.script.ScriptType;
 import org.elasticsearch.search.fetch.subphase.FetchSourceContext;
@@ -92,7 +89,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             }
             DeleteResponse deleteResponse = execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync);
             assertEquals("index", deleteResponse.getIndex());
-            assertEquals("_doc", deleteResponse.getType());
             assertEquals(docId, deleteResponse.getId());
             assertEquals(DocWriteResponse.Result.DELETED, deleteResponse.getResult());
         }
@@ -102,7 +98,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             DeleteRequest deleteRequest = new DeleteRequest("index", docId);
             DeleteResponse deleteResponse = execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync);
             assertEquals("index", deleteResponse.getIndex());
-            assertEquals("_doc", deleteResponse.getType());
             assertEquals(docId, deleteResponse.getId());
             assertEquals(DocWriteResponse.Result.NOT_FOUND, deleteResponse.getResult());
         }
@@ -129,7 +124,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             DeleteRequest deleteRequest = new DeleteRequest("index",  docId).versionType(VersionType.EXTERNAL).version(13);
             DeleteResponse deleteResponse = execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync);
             assertEquals("index", deleteResponse.getIndex());
-            assertEquals("_doc", deleteResponse.getType());
             assertEquals(docId, deleteResponse.getId());
             assertEquals(DocWriteResponse.Result.DELETED, deleteResponse.getResult());
         }
@@ -156,34 +150,11 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             DeleteRequest deleteRequest = new DeleteRequest("index",  docId).routing("foo");
             DeleteResponse deleteResponse = execute(deleteRequest, highLevelClient()::delete, highLevelClient()::deleteAsync);
             assertEquals("index", deleteResponse.getIndex());
-            assertEquals("_doc", deleteResponse.getType());
             assertEquals(docId, deleteResponse.getId());
             assertEquals(DocWriteResponse.Result.DELETED, deleteResponse.getResult());
         }
     }
 
-    public void testDeleteWithTypes() throws IOException {
-        String docId = "id";
-        IndexRequest indexRequest = new IndexRequest("index", "type", docId);
-        indexRequest.source(Collections.singletonMap("foo", "bar"));
-        execute(indexRequest,
-            highLevelClient()::index,
-            highLevelClient()::indexAsync,
-            expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE)
-        );
-
-        DeleteRequest deleteRequest = new DeleteRequest("index", "type", docId);
-        DeleteResponse deleteResponse = execute(deleteRequest,
-            highLevelClient()::delete,
-            highLevelClient()::deleteAsync,
-            expectWarnings(RestDeleteAction.TYPES_DEPRECATION_MESSAGE));
-
-        assertEquals("index", deleteResponse.getIndex());
-        assertEquals("type", deleteResponse.getType());
-        assertEquals(docId, deleteResponse.getId());
-        assertEquals(DocWriteResponse.Result.DELETED, deleteResponse.getResult());
-    }
-
     public void testExists() throws IOException {
         {
             GetRequest getRequest = new GetRequest("index", "id");
@@ -336,18 +307,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
         }
     }
 
-    public void testGetWithTypes() throws IOException {
-        String document = "{\"field\":\"value\"}";
-        IndexRequest indexRequest = new IndexRequest("index", "type", "id");
-        indexRequest.source(document, XContentType.JSON);
-        indexRequest.setRefreshPolicy(RefreshPolicy.IMMEDIATE);
-        execute(indexRequest,
-            highLevelClient()::index,
-            highLevelClient()::indexAsync,
-            expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE)
-        );
-    }
-
     public void testMultiGet() throws IOException {
         {
             MultiGetRequest multiGetRequest = new MultiGetRequest();
@@ -410,7 +369,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             assertEquals(RestStatus.CREATED, indexResponse.status());
             assertEquals(DocWriteResponse.Result.CREATED, indexResponse.getResult());
             assertEquals("index", indexResponse.getIndex());
-            assertEquals("_doc", indexResponse.getType());
             assertTrue(Strings.hasLength(indexResponse.getId()));
             assertEquals(1L, indexResponse.getVersion());
             assertNotNull(indexResponse.getShardId());
@@ -430,7 +388,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             IndexResponse indexResponse = execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
             assertEquals(RestStatus.CREATED, indexResponse.status());
             assertEquals("index", indexResponse.getIndex());
-            assertEquals("_doc", indexResponse.getType());
             assertEquals("id", indexResponse.getId());
             assertEquals(1L, indexResponse.getVersion());
 
@@ -440,7 +397,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             indexResponse = execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
             assertEquals(RestStatus.OK, indexResponse.status());
             assertEquals("index", indexResponse.getIndex());
-            assertEquals("_doc", indexResponse.getType());
             assertEquals("id", indexResponse.getId());
             assertEquals(2L, indexResponse.getVersion());
 
@@ -479,7 +435,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             IndexResponse indexResponse = execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
             assertEquals(RestStatus.CREATED, indexResponse.status());
             assertEquals("index", indexResponse.getIndex());
-            assertEquals("_doc", indexResponse.getType());
             assertEquals("external_version_type", indexResponse.getId());
             assertEquals(12L, indexResponse.getVersion());
         }
@@ -491,7 +446,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             IndexResponse indexResponse = execute(indexRequest, highLevelClient()::index, highLevelClient()::indexAsync);
             assertEquals(RestStatus.CREATED, indexResponse.status());
             assertEquals("index", indexResponse.getIndex());
-            assertEquals("_doc", indexResponse.getType());
             assertEquals("with_create_op_type", indexResponse.getId());
 
             ElasticsearchStatusException exception = expectThrows(ElasticsearchStatusException.class, () -> {
@@ -504,22 +458,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
         }
     }
 
-    public void testIndexWithTypes() throws IOException {
-        final XContentType xContentType = randomFrom(XContentType.values());
-        IndexRequest indexRequest = new IndexRequest("index", "some_type", "some_id");
-        indexRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("test", "test").endObject());
-        IndexResponse indexResponse = execute(
-            indexRequest,
-            highLevelClient()::index,
-            highLevelClient()::indexAsync,
-            expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE)
-        );
-        assertEquals(RestStatus.CREATED, indexResponse.status());
-        assertEquals("index", indexResponse.getIndex());
-        assertEquals("some_type", indexResponse.getType());
-        assertEquals("some_id",indexResponse.getId());
-    }
-
     public void testUpdate() throws IOException {
         {
             UpdateRequest updateRequest = new UpdateRequest("index", "does_not_exist");
@@ -528,7 +466,7 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             ElasticsearchStatusException exception = expectThrows(ElasticsearchStatusException.class, () ->
                     execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync));
             assertEquals(RestStatus.NOT_FOUND, exception.status());
-            assertEquals("Elasticsearch exception [type=document_missing_exception, reason=[_doc][does_not_exist]: document missing]",
+            assertEquals("Elasticsearch exception [type=document_missing_exception, reason=[does_not_exist]: document missing]",
                     exception.getMessage());
         }
         {
@@ -651,7 +589,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             UpdateResponse updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
             assertEquals(RestStatus.CREATED, updateResponse.status());
             assertEquals("index", updateResponse.getIndex());
-            assertEquals("_doc", updateResponse.getType());
             assertEquals("with_upsert", updateResponse.getId());
             GetResult getResult = updateResponse.getGetResult();
             assertEquals(1L, updateResponse.getVersion());
@@ -666,7 +603,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             UpdateResponse updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
             assertEquals(RestStatus.CREATED, updateResponse.status());
             assertEquals("index", updateResponse.getIndex());
-            assertEquals("_doc", updateResponse.getType());
             assertEquals("with_doc_as_upsert", updateResponse.getId());
             GetResult getResult = updateResponse.getGetResult();
             assertEquals(1L, updateResponse.getVersion());
@@ -682,7 +618,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             UpdateResponse updateResponse = execute(updateRequest, highLevelClient()::update, highLevelClient()::updateAsync);
             assertEquals(RestStatus.CREATED, updateResponse.status());
             assertEquals("index", updateResponse.getIndex());
-            assertEquals("_doc", updateResponse.getType());
             assertEquals("with_scripted_upsert", updateResponse.getId());
 
             GetResult getResult = updateResponse.getGetResult();
@@ -701,26 +636,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
         }
     }
 
-    public void testUpdateWithTypes() throws IOException {
-        IndexRequest indexRequest = new IndexRequest("index", "type", "id");
-        indexRequest.source(singletonMap("field", "value"));
-        IndexResponse indexResponse = execute(indexRequest,
-            highLevelClient()::index,
-            highLevelClient()::indexAsync,
-            expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE)
-        );
-
-        UpdateRequest updateRequest = new UpdateRequest("index", "type", "id");
-        updateRequest.doc(singletonMap("field", "updated"), randomFrom(XContentType.values()));
-        UpdateResponse updateResponse = execute(updateRequest,
-            highLevelClient()::update,
-            highLevelClient()::updateAsync,
-            expectWarnings(RestUpdateAction.TYPES_DEPRECATION_MESSAGE));
-
-        assertEquals(RestStatus.OK, updateResponse.status());
-        assertEquals(indexResponse.getVersion() + 1, updateResponse.getVersion());
-    }
-
     public void testBulk() throws IOException {
         int nbItems = randomIntBetween(10, 100);
         boolean[] errors = new boolean[nbItems];
@@ -907,7 +822,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             indexRequest.source("field", "value");
             IndexResponse indexResponse = highLevelClient().index(indexRequest, RequestOptions.DEFAULT);
             assertEquals(expectedIndex, indexResponse.getIndex());
-            assertEquals("_doc", indexResponse.getType());
             assertEquals("id#1", indexResponse.getId());
         }
         {
@@ -924,7 +838,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             indexRequest.source("field", "value");
             IndexResponse indexResponse = highLevelClient().index(indexRequest, RequestOptions.DEFAULT);
             assertEquals("index", indexResponse.getIndex());
-            assertEquals("_doc", indexResponse.getType());
             assertEquals(docId, indexResponse.getId());
         }
         {
@@ -947,7 +860,6 @@ public class CrudIT extends ESRestHighLevelClientTestCase {
             indexRequest.routing(routing);
             IndexResponse indexResponse = highLevelClient().index(indexRequest, RequestOptions.DEFAULT);
             assertEquals("index", indexResponse.getIndex());
-            assertEquals("_doc", indexResponse.getType());
             assertEquals("id", indexResponse.getId());
         }
         {

+ 3 - 3
client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java

@@ -2177,7 +2177,7 @@ public class MachineLearningIT extends ESRestHighLevelClientTestCase {
         String documentId = jobId + "_model_snapshot_" + snapshotId;
 
         String snapshotUpdate = "{ \"timestamp\": " + timestamp + "}";
-        UpdateRequest updateSnapshotRequest = new UpdateRequest(".ml-anomalies-" + jobId, "_doc", documentId);
+        UpdateRequest updateSnapshotRequest = new UpdateRequest(".ml-anomalies-" + jobId, documentId);
         updateSnapshotRequest.doc(snapshotUpdate.getBytes(StandardCharsets.UTF_8), XContentType.JSON);
         highLevelClient().update(updateSnapshotRequest, RequestOptions.DEFAULT);
     }
@@ -2197,7 +2197,7 @@ public class MachineLearningIT extends ESRestHighLevelClientTestCase {
         Job job = MachineLearningIT.buildJob(jobId);
         highLevelClient().machineLearning().putJob(new PutJobRequest(job), RequestOptions.DEFAULT);
 
-        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared", "_doc", documentId);
+        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared").id(documentId);
         indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
         indexRequest.source("{\"job_id\":\"" + jobId + "\", \"timestamp\":1541587919000, " +
             "\"description\":\"State persisted due to job close at 2018-11-07T10:51:59+0000\", " +
@@ -2217,7 +2217,7 @@ public class MachineLearningIT extends ESRestHighLevelClientTestCase {
 
         for(String snapshotId : snapshotIds) {
             String documentId = jobId + "_model_snapshot_" + snapshotId;
-            IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared", "_doc", documentId);
+            IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared").id(documentId);
             indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
             indexRequest.source("{\"job_id\":\"" + jobId + "\", \"timestamp\":1541587919000, " +
                 "\"description\":\"State persisted due to job close at 2018-11-07T10:51:59+0000\", " +

+ 0 - 76
client/rest-high-level/src/test/java/org/elasticsearch/client/RequestConvertersTests.java

@@ -287,18 +287,6 @@ public class RequestConvertersTests extends ESTestCase {
         assertNull(request.getEntity());
     }
 
-    public void testDeleteWithType() {
-        String index = randomAlphaOfLengthBetween(3, 10);
-        String type = randomAlphaOfLengthBetween(3, 10);
-        String id = randomAlphaOfLengthBetween(3, 10);
-        DeleteRequest deleteRequest = new DeleteRequest(index, type, id);
-
-        Request request = RequestConverters.delete(deleteRequest);
-        assertEquals(HttpDelete.METHOD_NAME, request.getMethod());
-        assertEquals("/" + index + "/" + type + "/" + id, request.getEndpoint());
-        assertNull(request.getEntity());
-    }
-
     public void testExists() {
         getAndExistsTest(RequestConverters::exists, HttpHead.METHOD_NAME);
     }
@@ -380,9 +368,6 @@ public class RequestConvertersTests extends ESTestCase {
         if (randomBoolean()) {
             reindexRequest.setSourceBatchSize(randomInt(100));
         }
-        if (randomBoolean()) {
-            reindexRequest.setDestDocType("tweet_and_doc");
-        }
         if (randomBoolean()) {
             reindexRequest.setDestOpType("create");
         }
@@ -646,49 +631,6 @@ public class RequestConvertersTests extends ESTestCase {
         }
     }
 
-    public void testIndexWithType() throws IOException {
-        String index = randomAlphaOfLengthBetween(3, 10);
-        String type = randomAlphaOfLengthBetween(3, 10);
-        IndexRequest indexRequest = new IndexRequest(index, type);
-        String id = randomBoolean() ? randomAlphaOfLengthBetween(3, 10) : null;
-        indexRequest.id(id);
-
-        String method = HttpPost.METHOD_NAME;
-        if (id != null) {
-            method = HttpPut.METHOD_NAME;
-            if (randomBoolean()) {
-                indexRequest.opType(DocWriteRequest.OpType.CREATE);
-            }
-        }
-        XContentType xContentType = randomFrom(XContentType.values());
-        int nbFields = randomIntBetween(0, 10);
-        try (XContentBuilder builder = XContentBuilder.builder(xContentType.xContent())) {
-            builder.startObject();
-            for (int i = 0; i < nbFields; i++) {
-                builder.field("field_" + i, i);
-            }
-            builder.endObject();
-            indexRequest.source(builder);
-        }
-
-        Request request = RequestConverters.index(indexRequest);
-        if (indexRequest.opType() == DocWriteRequest.OpType.CREATE) {
-            assertEquals("/" + index + "/" + type + "/" + id + "/_create", request.getEndpoint());
-        } else if (id != null) {
-            assertEquals("/" + index + "/" + type + "/" + id, request.getEndpoint());
-        } else {
-            assertEquals("/" + index + "/" + type, request.getEndpoint());
-        }
-        assertEquals(method, request.getMethod());
-
-        HttpEntity entity = request.getEntity();
-        assertTrue(entity instanceof NByteArrayEntity);
-        assertEquals(indexRequest.getContentType().mediaTypeWithoutParameters(), entity.getContentType().getValue());
-        try (XContentParser parser = createParser(xContentType.xContent(), entity.getContent())) {
-            assertEquals(nbFields, parser.map().size());
-        }
-    }
-
     public void testUpdate() throws IOException {
         XContentType xContentType = randomFrom(XContentType.values());
 
@@ -797,23 +739,6 @@ public class RequestConvertersTests extends ESTestCase {
         }
     }
 
-    public void testUpdateWithType() throws IOException {
-        String index = randomAlphaOfLengthBetween(3, 10);
-        String type = randomAlphaOfLengthBetween(3, 10);
-        String id = randomAlphaOfLengthBetween(3, 10);
-
-        UpdateRequest updateRequest = new UpdateRequest(index, type, id);
-
-        XContentType xContentType = XContentType.JSON;
-        BytesReference source = RandomObjects.randomSource(random(), xContentType);
-        updateRequest.doc(new IndexRequest().source(source, xContentType));
-
-        Request request = RequestConverters.update(updateRequest);
-        assertEquals("/" + index + "/" + type + "/" + id + "/_update", request.getEndpoint());
-        assertEquals(HttpPost.METHOD_NAME, request.getMethod());
-        assertToXContentBody(updateRequest, request.getEntity());
-    }
-
     public void testUpdateWithDifferentContentTypes() {
         IllegalStateException exception = expectThrows(IllegalStateException.class, () -> {
             UpdateRequest updateRequest = new UpdateRequest();
@@ -906,7 +831,6 @@ public class RequestConvertersTests extends ESTestCase {
 
             assertEquals(originalRequest.opType(), parsedRequest.opType());
             assertEquals(originalRequest.index(), parsedRequest.index());
-            assertEquals(originalRequest.type(), parsedRequest.type());
             assertEquals(originalRequest.id(), parsedRequest.id());
             assertEquals(originalRequest.routing(), parsedRequest.routing());
             assertEquals(originalRequest.version(), parsedRequest.version());

+ 5 - 11
client/rest-high-level/src/test/java/org/elasticsearch/client/SearchIT.java

@@ -52,7 +52,6 @@ import org.elasticsearch.index.query.TermsQueryBuilder;
 import org.elasticsearch.join.aggregations.Children;
 import org.elasticsearch.join.aggregations.ChildrenAggregationBuilder;
 import org.elasticsearch.rest.RestStatus;
-import org.elasticsearch.rest.action.document.RestIndexAction;
 import org.elasticsearch.script.Script;
 import org.elasticsearch.script.ScriptType;
 import org.elasticsearch.script.mustache.MultiSearchTemplateRequest;
@@ -114,24 +113,19 @@ public class SearchIT extends ESRestHighLevelClientTestCase {
     @Before
     public void indexDocuments() throws IOException {
         {
-            Request doc1 = new Request(HttpPut.METHOD_NAME, "/index/type/1");
-            doc1.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
+            Request doc1 = new Request(HttpPut.METHOD_NAME, "/index/_doc/1");
             doc1.setJsonEntity("{\"type\":\"type1\", \"num\":10, \"num2\":50}");
             client().performRequest(doc1);
-            Request doc2 = new Request(HttpPut.METHOD_NAME, "/index/type/2");
-            doc2.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
+            Request doc2 = new Request(HttpPut.METHOD_NAME, "/index/_doc/2");
             doc2.setJsonEntity("{\"type\":\"type1\", \"num\":20, \"num2\":40}");
             client().performRequest(doc2);
-            Request doc3 = new Request(HttpPut.METHOD_NAME, "/index/type/3");
-            doc3.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
+            Request doc3 = new Request(HttpPut.METHOD_NAME, "/index/_doc/3");
             doc3.setJsonEntity("{\"type\":\"type1\", \"num\":50, \"num2\":35}");
             client().performRequest(doc3);
-            Request doc4 = new Request(HttpPut.METHOD_NAME, "/index/type/4");
-            doc4.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
+            Request doc4 = new Request(HttpPut.METHOD_NAME, "/index/_doc/4");
             doc4.setJsonEntity("{\"type\":\"type2\", \"num\":100, \"num2\":10}");
             client().performRequest(doc4);
-            Request doc5 = new Request(HttpPut.METHOD_NAME, "/index/type/5");
-            doc5.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
+            Request doc5 = new Request(HttpPut.METHOD_NAME, "/index/_doc/5");
             doc5.setJsonEntity("{\"type\":\"type2\", \"num\":100, \"num2\":10}");
             client().performRequest(doc5);
         }

+ 8 - 8
client/rest-high-level/src/test/java/org/elasticsearch/client/TasksIT.java

@@ -71,7 +71,7 @@ public class TasksIT extends ESRestHighLevelClientTestCase {
         }
         assertTrue("List tasks were not found", listTasksFound);
     }
-    
+
     public void testGetValidTask() throws Exception {
 
         // Run a Reindex to create a task
@@ -86,7 +86,7 @@ public class TasksIT extends ESRestHighLevelClientTestCase {
                 .add(new IndexRequest(sourceIndex).id("2").source(Collections.singletonMap("foo2", "bar2"), XContentType.JSON))
                 .setRefreshPolicy(RefreshPolicy.IMMEDIATE);
         assertEquals(RestStatus.OK, highLevelClient().bulk(bulkRequest, RequestOptions.DEFAULT).status());
-        
+
         // (need to use low level client because currently high level client
         // doesn't support async return of task id - needs
         // https://github.com/elastic/elasticsearch/pull/35202 )
@@ -105,24 +105,24 @@ public class TasksIT extends ESRestHighLevelClientTestCase {
         gtr.setWaitForCompletion(randomBoolean());
         Optional<GetTaskResponse> getTaskResponse = execute(gtr, highLevelClient().tasks()::get, highLevelClient().tasks()::getAsync);
         assertTrue(getTaskResponse.isPresent());
-        GetTaskResponse taskResponse = getTaskResponse.get();        
+        GetTaskResponse taskResponse = getTaskResponse.get();
         if (gtr.getWaitForCompletion()) {
             assertTrue(taskResponse.isCompleted());
         }
         TaskInfo info = taskResponse.getTaskInfo();
         assertTrue(info.isCancellable());
-        assertEquals("reindex from [source1] to [dest][_doc]", info.getDescription());
+        assertEquals("reindex from [source1] to [dest]", info.getDescription());
         assertEquals("indices:data/write/reindex", info.getAction());
         if (taskResponse.isCompleted() == false) {
             assertBusy(ReindexIT.checkCompletionStatus(client(), taskId.toString()));
         }
-    }    
-    
+    }
+
     public void testGetInvalidTask() throws IOException {
         // Check 404s are returned as empty Optionals
-        GetTaskRequest gtr = new GetTaskRequest("doesNotExistNodeName", 123);                
+        GetTaskRequest gtr = new GetTaskRequest("doesNotExistNodeName", 123);
         Optional<GetTaskResponse> getTaskResponse = execute(gtr, highLevelClient().tasks()::get, highLevelClient().tasks()::getAsync);
-        assertFalse(getTaskResponse.isPresent());               
+        assertFalse(getTaskResponse.isPresent());
     }
 
     public void testCancelTasks() throws IOException {

+ 8 - 8
client/rest-high-level/src/test/java/org/elasticsearch/client/documentation/MlClientDocumentationIT.java

@@ -1152,7 +1152,7 @@ public class MlClientDocumentationIT extends ESRestHighLevelClientTestCase {
         client.machineLearning().putJob(new PutJobRequest(job), RequestOptions.DEFAULT);
 
         // Let us index a bucket
-        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared", "_doc");
+        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared");
         indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
         indexRequest.source("{\"job_id\":\"test-get-buckets\", \"result_type\":\"bucket\", \"timestamp\": 1533081600000," +
                         "\"bucket_span\": 600,\"is_interim\": false, \"anomaly_score\": 80.0}", XContentType.JSON);
@@ -1620,7 +1620,7 @@ public class MlClientDocumentationIT extends ESRestHighLevelClientTestCase {
         client.machineLearning().putJob(new PutJobRequest(job), RequestOptions.DEFAULT);
 
         // Let us index a record
-        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared", "_doc");
+        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared");
         indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
         indexRequest.source("{\"job_id\":\"test-get-records\", \"result_type\":\"record\", \"timestamp\": 1533081600000," +
                 "\"bucket_span\": 600,\"is_interim\": false, \"record_score\": 80.0}", XContentType.JSON);
@@ -1839,7 +1839,7 @@ public class MlClientDocumentationIT extends ESRestHighLevelClientTestCase {
         client.machineLearning().putJob(new PutJobRequest(job), RequestOptions.DEFAULT);
 
         // Let us index a record
-        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared", "_doc");
+        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared");
         indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
         indexRequest.source("{\"job_id\":\"test-get-influencers\", \"result_type\":\"influencer\", \"timestamp\": 1533081600000," +
                 "\"bucket_span\": 600,\"is_interim\": false, \"influencer_score\": 80.0, \"influencer_field_name\": \"my_influencer\"," +
@@ -1930,7 +1930,7 @@ public class MlClientDocumentationIT extends ESRestHighLevelClientTestCase {
         client.machineLearning().putJob(new PutJobRequest(job), RequestOptions.DEFAULT);
 
         // Let us index a category
-        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared", "_doc");
+        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared");
         indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
         indexRequest.source("{\"job_id\": \"test-get-categories\", \"category_id\": 1, \"terms\": \"AAL\"," +
                 " \"regex\": \".*?AAL.*\", \"max_matching_length\": 3, \"examples\": [\"AAL\"]}", XContentType.JSON);
@@ -2051,7 +2051,7 @@ public class MlClientDocumentationIT extends ESRestHighLevelClientTestCase {
         client.machineLearning().putJob(new PutJobRequest(job), RequestOptions.DEFAULT);
 
         // Let us index a snapshot
-        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared", "_doc");
+        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared");
         indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
         indexRequest.source("{\"job_id\":\"" + jobId + "\", \"timestamp\":1541587919000, " +
             "\"description\":\"State persisted due to job close at 2018-11-07T10:51:59+0000\", " +
@@ -2117,7 +2117,7 @@ public class MlClientDocumentationIT extends ESRestHighLevelClientTestCase {
         client.machineLearning().putJob(new PutJobRequest(job), RequestOptions.DEFAULT);
 
         // Let us index a snapshot
-        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared", "_doc");
+        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared");
         indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
         indexRequest.source("{\"job_id\":\"test-get-model-snapshots\", \"timestamp\":1541587919000, " +
             "\"description\":\"State persisted due to job close at 2018-11-07T10:51:59+0000\", " +
@@ -2215,7 +2215,7 @@ public class MlClientDocumentationIT extends ESRestHighLevelClientTestCase {
 
         // Let us index a snapshot
         String documentId = jobId + "_model_snapshot_" + snapshotId;
-        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared", "_doc", documentId);
+        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared").id(documentId);
         indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
         indexRequest.source("{\"job_id\":\"test-revert-model-snapshot\", \"timestamp\":1541587919000, " +
             "\"description\":\"State persisted due to job close at 2018-11-07T10:51:59+0000\", " +
@@ -2291,7 +2291,7 @@ public class MlClientDocumentationIT extends ESRestHighLevelClientTestCase {
         client.machineLearning().putJob(new PutJobRequest(job), RequestOptions.DEFAULT);
 
         // Let us index a snapshot
-        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared", "_doc", documentId);
+        IndexRequest indexRequest = new IndexRequest(".ml-anomalies-shared").id(documentId);
         indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
         indexRequest.source("{\"job_id\":\"test-update-model-snapshot\", \"timestamp\":1541587919000, " +
             "\"description\":\"State persisted due to job close at 2018-11-07T10:51:59+0000\", " +

+ 1 - 1
distribution/archives/integ-test-zip/src/test/java/org/elasticsearch/test/rest/RequestsWithoutContentIT.java

@@ -30,7 +30,7 @@ public class RequestsWithoutContentIT extends ESRestTestCase {
 
     public void testIndexMissingBody() throws IOException {
         ResponseException responseException = expectThrows(ResponseException.class, () ->
-                client().performRequest(new Request(randomBoolean() ? "POST" : "PUT", "/idx/type/123")));
+                client().performRequest(new Request(randomBoolean() ? "POST" : "PUT", "/idx/_doc/123")));
         assertResponseException(responseException, "request body is required");
     }
 

+ 3 - 3
docs/reference/aggregations/bucket/autodatehistogram-aggregation.asciidoc

@@ -119,17 +119,17 @@ Consider the following example:
 
 [source,console]
 ---------------------------------
-PUT my_index/log/1?refresh
+PUT my_index/_doc/1?refresh
 {
   "date": "2015-10-01T00:30:00Z"
 }
 
-PUT my_index/log/2?refresh
+PUT my_index/_doc/2?refresh
 {
   "date": "2015-10-01T01:30:00Z"
 }
 
-PUT my_index/log/3?refresh
+PUT my_index/_doc/3?refresh
 {
   "date": "2015-10-01T02:30:00Z"
 }

+ 3 - 3
docs/reference/api-conventions.asciidoc

@@ -335,11 +335,11 @@ parameter like this:
 
 [source,console]
 --------------------------------------------------
-POST /library/book?refresh
+POST /library/_doc?refresh
 {"title": "Book #1", "rating": 200.1}
-POST /library/book?refresh
+POST /library/_doc?refresh
 {"title": "Book #2", "rating": 1.7}
-POST /library/book?refresh
+POST /library/_doc?refresh
 {"title": "Book #3", "rating": 0.1}
 GET /_search?filter_path=hits.hits._source&_source=title&sort=rating:desc
 --------------------------------------------------

+ 1 - 1
docs/reference/cat/count.asciidoc

@@ -79,7 +79,7 @@ the cluster.
 GET /_cat/count?v
 --------------------------------------------------
 // TEST[setup:big_twitter]
-// TEST[s/^/POST test\/test\?refresh\n{"test": "test"}\n/]
+// TEST[s/^/POST test\/_doc\?refresh\n{"test": "test"}\n/]
 
 The API returns the following response:
 

+ 1 - 1
docs/reference/cat/segments.asciidoc

@@ -108,7 +108,7 @@ include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
 --------------------------------------------------
 GET /_cat/segments?v
 --------------------------------------------------
-// TEST[s/^/PUT \/test\/test\/1?refresh\n{"test":"test"}\nPUT \/test1\/test\/1?refresh\n{"test":"test"}\n/]
+// TEST[s/^/PUT \/test\/_doc\/1?refresh\n{"test":"test"}\nPUT \/test1\/_doc\/1?refresh\n{"test":"test"}\n/]
 
 The API returns the following response:
 

+ 1 - 5
docs/reference/docs/bulk.asciidoc

@@ -120,7 +120,7 @@ $ cat requests
 { "index" : { "_index" : "test", "_id" : "1" } }
 { "field1" : "value1" }
 $ curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/_bulk --data-binary "@requests"; echo
-{"took":7, "errors": false, "items":[{"index":{"_index":"test","_type":"_doc","_id":"1","_version":1,"result":"created","forced_refresh":false}}]}
+{"took":7, "errors": false, "items":[{"index":{"_index":"test","_id":"1","_version":1,"result":"created","forced_refresh":false}}]}
 --------------------------------------------------
 // NOTCONSOLE
 // Not converting to console because this shows how curl works
@@ -240,7 +240,6 @@ The API returns the following result:
       {
          "index": {
             "_index": "test",
-            "_type": "_doc",
             "_id": "1",
             "_version": 1,
             "result": "created",
@@ -257,7 +256,6 @@ The API returns the following result:
       {
          "delete": {
             "_index": "test",
-            "_type": "_doc",
             "_id": "2",
             "_version": 1,
             "result": "not_found",
@@ -274,7 +272,6 @@ The API returns the following result:
       {
          "create": {
             "_index": "test",
-            "_type": "_doc",
             "_id": "3",
             "_version": 1,
             "result": "created",
@@ -291,7 +288,6 @@ The API returns the following result:
       {
          "update": {
             "_index": "test",
-            "_type": "_doc",
             "_id": "1",
             "_version": 2,
             "result": "updated",

+ 0 - 1
docs/reference/docs/concurrency-control.asciidoc

@@ -42,7 +42,6 @@ You can see the assigned sequence number and primary term in the
     },
     "_index" : "products",
     "_id" : "1567",
-    "_type" : "_doc",
     "_version" : 1,
     "_seq_no" : 362,
     "_primary_term" : 2,

+ 0 - 1
docs/reference/docs/delete.asciidoc

@@ -181,7 +181,6 @@ The API returns the following result:
         "successful" : 2
     },
     "_index" : "twitter",
-    "_type" : "_doc",
     "_id" : "1",
     "_version" : 2,
     "_primary_term": 1,

+ 0 - 2
docs/reference/docs/index_.asciidoc

@@ -211,7 +211,6 @@ The API returns the following result:
         "successful" : 2
     },
     "_index" : "twitter",
-    "_type" : "_doc",
     "_id" : "W0tpsmIBdwcYyG50zbta",
     "_version" : 1,
     "_seq_no" : 0,
@@ -470,7 +469,6 @@ The API returns the following result:
         "successful" : 2
     },
     "_index" : "twitter",
-    "_type" : "_doc",
     "_id" : "1",
     "_version" : 1,
     "_seq_no" : 0,

+ 1 - 1
docs/reference/docs/reindex.asciidoc

@@ -666,7 +666,7 @@ POST _reindex
 }
 --------------------------------------------------
 // TEST[setup:twitter]
-// TEST[s/^/PUT blog\/post\/post1?refresh\n{"test": "foo"}\n/]
+// TEST[s/^/PUT blog\/_doc\/post1?refresh\n{"test": "foo"}\n/]
 
 NOTE: The Reindex API makes no effort to handle ID collisions so the last
 document written will "win" but the order isn't usually predictable so it is

+ 0 - 1
docs/reference/docs/update.asciidoc

@@ -237,7 +237,6 @@ request is ignored and the `result` element in the response returns `noop`:
         "failed": 0
    },
    "_index": "test",
-   "_type": "_doc",
    "_id": "1",
    "_version": 7,
    "_primary_term": 1,

+ 0 - 1
docs/reference/getting-started.asciidoc

@@ -230,7 +230,6 @@ operation was that version 1 of the document was created:
 {
   "_index" : "customer",
   "_id" : "1",
-  "_type" : "_doc",
   "_version" : 1,
   "result" : "created",
   "_shards" : {

+ 0 - 1
docs/reference/indices/rollover-index.asciidoc

@@ -414,7 +414,6 @@ PUT logs/_doc/2 <2>
 --------------------------------------------------
 {
   "_index" : "my_logs_index-000002",
-  "_type" : "_doc",
   "_id" : "2",
   "_version" : 1,
   "result" : "created",

+ 2 - 2
docs/reference/indices/segments.asciidoc

@@ -106,7 +106,7 @@ Contains information about whether high compression was enabled.
 --------------------------------------------------
 GET /test/_segments
 --------------------------------------------------
-// TEST[s/^/PUT test\n{"settings":{"number_of_shards":1, "number_of_replicas": 0}}\nPOST test\/test\?refresh\n{"test": "test"}\n/]
+// TEST[s/^/PUT test\n{"settings":{"number_of_shards":1, "number_of_replicas": 0}}\nPOST test\/_doc\?refresh\n{"test": "test"}\n/]
 
 
 ===== Get segment information for several indices
@@ -124,7 +124,7 @@ GET /test1,test2/_segments
 --------------------------------------------------
 GET /_segments
 --------------------------------------------------
-// TEST[s/^/PUT test\n{"settings":{"number_of_shards":1, "number_of_replicas": 0}}\nPOST test\/test\?refresh\n{"test": "test"}\n/]
+// TEST[s/^/PUT test\n{"settings":{"number_of_shards":1, "number_of_replicas": 0}}\nPOST test\/_doc\?refresh\n{"test": "test"}\n/]
 
 The API returns the following response:
 

+ 1 - 1
docs/reference/indices/shard-stores.asciidoc

@@ -136,7 +136,7 @@ for assigned primary and replica shards.
 GET /_shard_stores?status=green
 --------------------------------------------------
 // TEST[setup:node]
-// TEST[s/^/PUT my-index\n{"settings":{"number_of_shards":1, "number_of_replicas": 0}}\nPOST my-index\/test\?refresh\n{"test": "test"}\n/]
+// TEST[s/^/PUT my-index\n{"settings":{"number_of_shards":1, "number_of_replicas": 0}}\nPOST my-index\/_doc\?refresh\n{"test": "test"}\n/]
 
 The API returns the following response:
 

+ 0 - 1
docs/reference/ingest.asciidoc

@@ -61,7 +61,6 @@ Response:
 --------------------------------------------------
 {
   "_index" : "my-index",
-  "_type" : "_doc",
   "_id" : "my-id",
   "_version" : 1,
   "result" : "created",

+ 0 - 8
docs/reference/ingest/apis/simulate-pipeline.asciidoc

@@ -176,7 +176,6 @@ The API returns the following response:
          "doc": {
             "_id": "id",
             "_index": "index",
-            "_type": "_doc",
             "_source": {
                "field2": "_value",
                "foo": "bar"
@@ -190,7 +189,6 @@ The API returns the following response:
          "doc": {
             "_id": "id",
             "_index": "index",
-            "_type": "_doc",
             "_source": {
                "field2": "_value",
                "foo": "rab"
@@ -255,7 +253,6 @@ The API returns the following response:
          "doc": {
             "_id": "id",
             "_index": "index",
-            "_type": "_doc",
             "_source": {
                "field2": "_value",
                "foo": "bar"
@@ -269,7 +266,6 @@ The API returns the following response:
          "doc": {
             "_id": "id",
             "_index": "index",
-            "_type": "_doc",
             "_source": {
                "field2": "_value",
                "foo": "rab"
@@ -349,7 +345,6 @@ The API returns the following response:
                "doc": {
                   "_id": "id",
                   "_index": "index",
-                  "_type": "_doc",
                   "_source": {
                      "field2": "_value2",
                      "foo": "bar"
@@ -363,7 +358,6 @@ The API returns the following response:
                "doc": {
                   "_id": "id",
                   "_index": "index",
-                  "_type": "_doc",
                   "_source": {
                      "field3": "_value3",
                      "field2": "_value2",
@@ -382,7 +376,6 @@ The API returns the following response:
                "doc": {
                   "_id": "id",
                   "_index": "index",
-                  "_type": "_doc",
                   "_source": {
                      "field2": "_value2",
                      "foo": "rab"
@@ -396,7 +389,6 @@ The API returns the following response:
                "doc": {
                   "_id": "id",
                   "_index": "index",
-                  "_type": "_doc",
                   "_source": {
                      "field3": "_value3",
                      "field2": "_value2",

+ 0 - 1
docs/reference/ingest/ingest-node.asciidoc

@@ -198,7 +198,6 @@ Results in nothing indexed since the conditional evaluated to `true`.
 --------------------------------------------------
 {
   "_index": "test",
-  "_type": "_doc",
   "_id": "1",
   "_version": -3,
   "result": "noop",

+ 0 - 2
docs/reference/ingest/processors/date-index-name.asciidoc

@@ -49,7 +49,6 @@ PUT /myindex/_doc/1?pipeline=monthlyindex
 --------------------------------------------------
 {
   "_index" : "myindex-2016-04-01",
-  "_type" : "_doc",
   "_id" : "1",
   "_version" : 1,
   "result" : "created",
@@ -109,7 +108,6 @@ and the result:
       "doc" : {
         "_id" : "_id",
         "_index" : "<myindex-{2016-04-25||/M{yyyy-MM-dd|UTC}}>",
-        "_type" : "_doc",
         "_source" : {
           "date1" : "2016-04-25T12:02:01.789Z"
         },

+ 0 - 2
docs/reference/ingest/processors/grok.asciidoc

@@ -192,7 +192,6 @@ response:
   "docs": [
     {
       "doc": {
-        "_type": "_doc",
         "_index": "_index",
         "_id": "_id",
         "_source": {
@@ -252,7 +251,6 @@ POST _ingest/pipeline/_simulate
   "docs": [
     {
       "doc": {
-        "_type": "_doc",
         "_index": "_index",
         "_id": "_id",
         "_source": {

+ 0 - 1
docs/reference/ingest/processors/pipeline.asciidoc

@@ -83,7 +83,6 @@ Response from the index request:
 --------------------------------------------------
 {
   "_index": "myindex",
-  "_type": "_doc",
   "_id": "1",
   "_version": 1,
   "result": "created",

+ 3 - 5
docs/reference/ingest/processors/script.asciidoc

@@ -42,21 +42,20 @@ numeric fields `field_a` and `field_b` multiplied by the parameter param_c:
 --------------------------------------------------
 // NOTCONSOLE
 
-It is possible to use the Script Processor to manipulate document metadata like `_index` and `_type` during
-ingestion. Here is an example of an Ingest Pipeline that renames the index and type to `my_index` no matter what
+It is possible to use the Script Processor to manipulate document metadata like `_index` during
+ingestion. Here is an example of an Ingest Pipeline that renames the index to `my_index` no matter what
 was provided in the original index request:
 
 [source,console]
 --------------------------------------------------
 PUT _ingest/pipeline/my_index
 {
-    "description": "use index:my_index and type:_doc",
+    "description": "use index:my_index",
     "processors": [
       {
         "script": {
           "source": """
             ctx._index = 'my_index';
-            ctx._type = '_doc';
           """
         }
       }
@@ -81,7 +80,6 @@ The response from the above index request:
 --------------------------------------------------
 {
   "_index": "my_index",
-  "_type": "_doc",
   "_id": "1",
   "_version": 1,
   "result": "created",

+ 0 - 1
docs/reference/ingest/processors/set.asciidoc

@@ -64,7 +64,6 @@ Result:
     {
       "doc" : {
         "_index" : "_index",
-        "_type" : "_doc",
         "_id" : "_id",
         "_source" : {
           "host" : {

+ 0 - 40
docs/reference/mapping/removal_of_types.asciidoc

@@ -532,7 +532,6 @@ PUT index/_doc/1
 {
   "_index": "index",
   "_id": "1",
-  "_type": "_doc",
   "_version": 1,
   "result": "created",
   "_shards": {
@@ -593,45 +592,6 @@ When calling a search API such `_search`, `_msearch`, or `_explain`, types
 should not be included in the URL. Additionally, the `_type` field should not
 be used in queries, aggregations, or scripts.
 
-[float]
-==== Types in responses
-
-The document and search APIs will continue to return a `_type` key in
-responses, to avoid breaks to response parsing. However, the key is
-considered deprecated and should no longer be referenced. Types will
-be completely removed from responses in 8.0.
-
-Note that when a deprecated typed API is used, the index's mapping type will be
-returned as normal, but that typeless APIs will return the dummy type `_doc`
-in the response. For example, the following typeless `get` call will always
-return `_doc` as the type, even if the mapping has a custom type name like
-`my_type`:
-
-[source,console]
---------------------------------------------------
-PUT index/my_type/1
-{
-  "foo": "baz"
-}
-
-GET index/_doc/1
---------------------------------------------------
-
-[source,console-result]
---------------------------------------------------
-{
-    "_index" : "index",
-    "_id" : "1",
-    "_version" : 1,
-    "_seq_no" : 0,
-    "_primary_term" : 1,
-    "found": true,
-    "_source" : {
-        "foo" : "baz"
-    }
-}
---------------------------------------------------
-
 [float]
 ==== Index templates
 

+ 0 - 1
docs/reference/query-dsl/percolate-query.asciidoc

@@ -293,7 +293,6 @@ Index response:
 --------------------------------------------------
 {
   "_index": "my-index",
-  "_type": "_doc",
   "_id": "2",
   "_version": 1,
   "_shards": {

+ 6 - 6
modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/DateIndexNameProcessorTests.java

@@ -39,7 +39,7 @@ public class DateIndexNameProcessorTests extends ESTestCase {
         Function<String, ZonedDateTime> function = DateFormat.Java.getFunction("yyyy-MM-dd'T'HH:mm:ss.SSSXX", ZoneOffset.UTC, Locale.ROOT);
         DateIndexNameProcessor processor = createProcessor("_field", Collections.singletonList(function),
             ZoneOffset.UTC, "events-", "y", "yyyyMMdd");
-        IngestDocument document = new IngestDocument("_index", "_type", "_id", null, null, null,
+        IngestDocument document = new IngestDocument("_index", "_id", null, null, null,
                 Collections.singletonMap("_field", "2016-04-25T12:24:20.101Z"));
         processor.execute(document);
         assertThat(document.getSourceAndMetadata().get("_index"), equalTo("<events-{20160425||/y{yyyyMMdd|UTC}}>"));
@@ -49,7 +49,7 @@ public class DateIndexNameProcessorTests extends ESTestCase {
         Function<String, ZonedDateTime> function = DateFormat.Tai64n.getFunction(null, ZoneOffset.UTC, null);
         DateIndexNameProcessor dateProcessor = createProcessor("_field", Collections.singletonList(function),
                 ZoneOffset.UTC, "events-", "m", "yyyyMMdd");
-        IngestDocument document = new IngestDocument("_index", "_type", "_id", null, null, null,
+        IngestDocument document = new IngestDocument("_index", "_id", null, null, null,
                 Collections.singletonMap("_field", (randomBoolean() ? "@" : "") + "4000000050d506482dbdf024"));
         dateProcessor.execute(document);
         assertThat(document.getSourceAndMetadata().get("_index"), equalTo("<events-{20121222||/m{yyyyMMdd|UTC}}>"));
@@ -59,12 +59,12 @@ public class DateIndexNameProcessorTests extends ESTestCase {
         Function<String, ZonedDateTime> function = DateFormat.UnixMs.getFunction(null, ZoneOffset.UTC, null);
         DateIndexNameProcessor dateProcessor = createProcessor("_field", Collections.singletonList(function),
                 ZoneOffset.UTC, "events-", "m", "yyyyMMdd");
-        IngestDocument document = new IngestDocument("_index", "_type", "_id", null, null, null,
+        IngestDocument document = new IngestDocument("_index", "_id", null, null, null,
                 Collections.singletonMap("_field", "1000500"));
         dateProcessor.execute(document);
         assertThat(document.getSourceAndMetadata().get("_index"), equalTo("<events-{19700101||/m{yyyyMMdd|UTC}}>"));
 
-        document = new IngestDocument("_index", "_type", "_id", null, null, null,
+        document = new IngestDocument("_index", "_id", null, null, null,
                 Collections.singletonMap("_field", 1000500L));
         dateProcessor.execute(document);
         assertThat(document.getSourceAndMetadata().get("_index"), equalTo("<events-{19700101||/m{yyyyMMdd|UTC}}>"));
@@ -74,7 +74,7 @@ public class DateIndexNameProcessorTests extends ESTestCase {
         Function<String, ZonedDateTime> function = DateFormat.Unix.getFunction(null, ZoneOffset.UTC, null);
         DateIndexNameProcessor dateProcessor = createProcessor("_field", Collections.singletonList(function),
                 ZoneOffset.UTC, "events-", "m", "yyyyMMdd");
-        IngestDocument document = new IngestDocument("_index", "_type", "_id", null, null, null,
+        IngestDocument document = new IngestDocument("_index", "_id", null, null, null,
                 Collections.singletonMap("_field", "1000.5"));
         dateProcessor.execute(document);
         assertThat(document.getSourceAndMetadata().get("_index"), equalTo("<events-{19700101||/m{yyyyMMdd|UTC}}>"));
@@ -91,7 +91,7 @@ public class DateIndexNameProcessorTests extends ESTestCase {
             Collections.singletonList(dateTimeFunction),  ZoneOffset.UTC, indexNamePrefix,
             dateRounding, indexNameFormat);
 
-        IngestDocument document = new IngestDocument("_index", "_type", "_id", null, null, null,
+        IngestDocument document = new IngestDocument("_index", "_id", null, null, null,
             Collections.singletonMap("_field", date));
         dateProcessor.execute(document);
 

+ 4 - 4
modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/DissectProcessorTests.java

@@ -40,7 +40,7 @@ import static org.hamcrest.Matchers.equalTo;
 public class DissectProcessorTests extends ESTestCase {
 
     public void testMatch() {
-        IngestDocument ingestDocument = new IngestDocument("_index", "_type", "_id", null, null, null,
+        IngestDocument ingestDocument = new IngestDocument("_index", "_id", null, null, null,
             Collections.singletonMap("message", "foo,bar,baz"));
         DissectProcessor dissectProcessor = new DissectProcessor("", "message", "%{a},%{b},%{c}", "", true);
         dissectProcessor.execute(ingestDocument);
@@ -50,7 +50,7 @@ public class DissectProcessorTests extends ESTestCase {
     }
 
     public void testMatchOverwrite() {
-        IngestDocument ingestDocument = new IngestDocument("_index", "_type", "_id", null, null, null,
+        IngestDocument ingestDocument = new IngestDocument("_index", "_id", null, null, null,
             MapBuilder.<String, Object>newMapBuilder()
                 .put("message", "foo,bar,baz")
                 .put("a", "willgetstompped")
@@ -64,7 +64,7 @@ public class DissectProcessorTests extends ESTestCase {
     }
 
     public void testAdvancedMatch() {
-        IngestDocument ingestDocument = new IngestDocument("_index", "_type", "_id", null, null, null,
+        IngestDocument ingestDocument = new IngestDocument("_index", "_id", null, null, null,
             Collections.singletonMap("message", "foo       bar,,,,,,,baz nope:notagain 😊 🐇 🙃"));
         DissectProcessor dissectProcessor =
             new DissectProcessor("", "message", "%{a->} %{*b->},%{&b} %{}:%{?skipme} %{+smile/2} 🐇 %{+smile/1}", "::::", true);
@@ -77,7 +77,7 @@ public class DissectProcessorTests extends ESTestCase {
     }
 
     public void testMiss() {
-        IngestDocument ingestDocument = new IngestDocument("_index", "_type", "_id", null, null, null,
+        IngestDocument ingestDocument = new IngestDocument("_index", "_id", null, null, null,
             Collections.singletonMap("message", "foo:bar,baz"));
         DissectProcessor dissectProcessor = new DissectProcessor("", "message", "%{a},%{b},%{c}", "", true);
         DissectException e = expectThrows(DissectException.class, () -> dissectProcessor.execute(ingestDocument));

+ 9 - 12
modules/ingest-common/src/test/java/org/elasticsearch/ingest/common/ForEachProcessorTests.java

@@ -46,7 +46,7 @@ public class ForEachProcessorTests extends ESTestCase {
         values.add("bar");
         values.add("baz");
         IngestDocument ingestDocument = new IngestDocument(
-            "_index", "_type", "_id", null, null, null, Collections.singletonMap("values", values)
+            "_index", "_id", null, null, null, Collections.singletonMap("values", values)
         );
 
         ForEachProcessor processor = new ForEachProcessor(
@@ -64,7 +64,7 @@ public class ForEachProcessorTests extends ESTestCase {
 
     public void testExecuteWithFailure() throws Exception {
         IngestDocument ingestDocument = new IngestDocument(
-            "_index", "_type", "_id", null, null, null, Collections.singletonMap("values", Arrays.asList("a", "b", "c"))
+            "_index", "_id", null, null, null, Collections.singletonMap("values", Arrays.asList("a", "b", "c"))
         );
 
         TestProcessor testProcessor = new TestProcessor(id -> {
@@ -102,12 +102,11 @@ public class ForEachProcessorTests extends ESTestCase {
         values.add(new HashMap<>());
         values.add(new HashMap<>());
         IngestDocument ingestDocument = new IngestDocument(
-            "_index", "_type", "_id", null, null, null, Collections.singletonMap("values", values)
+            "_index", "_id", null, null, null, Collections.singletonMap("values", values)
         );
 
         TestProcessor innerProcessor = new TestProcessor(id -> {
             id.setFieldValue("_ingest._value.index", id.getSourceAndMetadata().get("_index"));
-            id.setFieldValue("_ingest._value.type", id.getSourceAndMetadata().get("_type"));
             id.setFieldValue("_ingest._value.id", id.getSourceAndMetadata().get("_id"));
         });
         ForEachProcessor processor = new ForEachProcessor("_tag", "values", innerProcessor, false);
@@ -115,10 +114,8 @@ public class ForEachProcessorTests extends ESTestCase {
 
         assertThat(innerProcessor.getInvokedCounter(), equalTo(2));
         assertThat(ingestDocument.getFieldValue("values.0.index", String.class), equalTo("_index"));
-        assertThat(ingestDocument.getFieldValue("values.0.type", String.class), equalTo("_type"));
         assertThat(ingestDocument.getFieldValue("values.0.id", String.class), equalTo("_id"));
         assertThat(ingestDocument.getFieldValue("values.1.index", String.class), equalTo("_index"));
-        assertThat(ingestDocument.getFieldValue("values.1.type", String.class), equalTo("_type"));
         assertThat(ingestDocument.getFieldValue("values.1.id", String.class), equalTo("_id"));
     }
 
@@ -133,7 +130,7 @@ public class ForEachProcessorTests extends ESTestCase {
         document.put("values", values);
         document.put("flat_values", new ArrayList<>());
         document.put("other", "value");
-        IngestDocument ingestDocument = new IngestDocument("_index", "_type", "_id", null, null, null, document);
+        IngestDocument ingestDocument = new IngestDocument("_index", "_id", null, null, null, document);
 
         ForEachProcessor processor = new ForEachProcessor(
             "_tag", "values", new SetProcessor("_tag",
@@ -173,7 +170,7 @@ public class ForEachProcessorTests extends ESTestCase {
             values.add("");
         }
         IngestDocument ingestDocument = new IngestDocument(
-            "_index", "_type", "_id", null, null, null, Collections.singletonMap("values", values)
+            "_index", "_id", null, null, null, Collections.singletonMap("values", values)
         );
 
         ForEachProcessor processor = new ForEachProcessor("_tag", "values", innerProcessor, false);
@@ -192,7 +189,7 @@ public class ForEachProcessorTests extends ESTestCase {
         values.add(1);
         values.add(null);
         IngestDocument ingestDocument = new IngestDocument(
-                "_index", "_type", "_id", null, null, null, Collections.singletonMap("values", values)
+                "_index", "_id", null, null, null, Collections.singletonMap("values", values)
         );
 
         TemplateScript.Factory template = new TestTemplateService.MockTemplateScript.Factory("errors");
@@ -222,7 +219,7 @@ public class ForEachProcessorTests extends ESTestCase {
         source.put("_value", "new_value");
         source.put("values", values);
         IngestDocument ingestDocument = new IngestDocument(
-                "_index", "_type", "_id", null, null, null, source
+                "_index", "_id", null, null, null, source
         );
 
         TestProcessor processor = new TestProcessor(doc -> doc.setFieldValue("_ingest._value",
@@ -253,7 +250,7 @@ public class ForEachProcessorTests extends ESTestCase {
         values.add(value);
 
         IngestDocument ingestDocument = new IngestDocument(
-                "_index", "_type", "_id", null, null, null, Collections.singletonMap("values1", values)
+                "_index", "_id", null, null, null, Collections.singletonMap("values1", values)
         );
 
         TestProcessor testProcessor = new TestProcessor(
@@ -274,7 +271,7 @@ public class ForEachProcessorTests extends ESTestCase {
 
     public void testIgnoreMissing() throws Exception {
         IngestDocument originalIngestDocument = new IngestDocument(
-            "_index", "_type", "_id", null, null, null, Collections.emptyMap()
+            "_index", "_id", null, null, null, Collections.emptyMap()
         );
         IngestDocument ingestDocument = new IngestDocument(originalIngestDocument);
         TestProcessor testProcessor = new TestProcessor(doc -> {});

+ 2 - 2
modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpProcessorFactoryTests.java

@@ -260,7 +260,7 @@ public class GeoIpProcessorFactoryTests extends ESTestCase {
         }
 
         final Map<String, Object> field = Collections.singletonMap("_field", "1.1.1.1");
-        final IngestDocument document = new IngestDocument("index", "type", "id", "routing", 1L, VersionType.EXTERNAL, field);
+        final IngestDocument document = new IngestDocument("index", "id", "routing", 1L, VersionType.EXTERNAL, field);
 
         Map<String, Object> config = new HashMap<>();
         config.put("field", "_field");
@@ -317,7 +317,7 @@ public class GeoIpProcessorFactoryTests extends ESTestCase {
         }
 
         final Map<String, Object> field = Collections.singletonMap("_field", "1.1.1.1");
-        final IngestDocument document = new IngestDocument("index", "type", "id", "routing", 1L, VersionType.EXTERNAL, field);
+        final IngestDocument document = new IngestDocument("index", "id", "routing", 1L, VersionType.EXTERNAL, field);
 
         Map<String, Object> config = new HashMap<>();
         config.put("field", "_field");

+ 1 - 1
modules/ingest-geoip/src/test/java/org/elasticsearch/ingest/geoip/GeoIpProcessorNonIngestNodeTests.java

@@ -149,7 +149,7 @@ public class GeoIpProcessorNonIngestNodeTests extends ESIntegTestCase {
         internalCluster().getInstance(IngestService.class, ingestNode);
         // the geo-IP database should not be loaded yet as we have no indexed any documents using a pipeline that has a geo-IP processor
         assertDatabaseLoadStatus(ingestNode, false);
-        final IndexRequest indexRequest = new IndexRequest("index", "_doc");
+        final IndexRequest indexRequest = new IndexRequest("index");
         indexRequest.setPipeline("geoip");
         indexRequest.source(Collections.singletonMap("ip", "1.1.1.1"));
         final IndexResponse indexResponse = client().index(indexRequest).actionGet();

+ 0 - 4
modules/lang-painless/src/test/resources/rest-api-spec/test/painless/15_update.yml

@@ -20,7 +20,6 @@
               params: { bar: 'xxx' }
 
   - match: { _index:   test_1 }
-  - match: { _type:    _doc   }
   - match: { _id:      "1"    }
   - match: { _version: 2      }
 
@@ -42,7 +41,6 @@
               source: "ctx._source.foo = 'yyy'"
 
   - match: { _index:   test_1 }
-  - match: { _type:    _doc   }
   - match: { _id:      "1"    }
   - match: { _version: 3      }
 
@@ -64,7 +62,6 @@
               source: "ctx._source.missing_length = ctx._source.missing?.length()"
 
   - match: { _index:   test_1 }
-  - match: { _type:    _doc   }
   - match: { _id:      "1"    }
   - match: { _version: 4      }
 
@@ -88,7 +85,6 @@
               source: "ctx._source.foo_length = ctx._source.foo?.length()"
 
   - match: { _index:   test_1 }
-  - match: { _type:    _doc   }
   - match: { _id:      "1"    }
   - match: { _version: 5      }
 

+ 0 - 2
modules/mapper-extras/src/test/resources/rest-api-spec/test/search-as-you-type/10_basic.yml

@@ -19,7 +19,6 @@ setup:
   - do:
       index:
         index: test
-        type: _doc
         id: 1
         body:
           a_field: "quick brown fox jump lazy dog"
@@ -28,7 +27,6 @@ setup:
   - do:
       index:
         index: test
-        type: _doc
         id: 2
         body:
           a_field: "xylophone xylophone xylophone"

+ 0 - 1
modules/mapper-extras/src/test/resources/rest-api-spec/test/search-as-you-type/20_highlighting.yml

@@ -22,7 +22,6 @@ setup:
   - do:
       index:
         index: test
-        type: _doc
         id: 1
         body:
           a_field: "quick brown fox jump lazy dog"

+ 3 - 5
modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java

@@ -318,7 +318,7 @@ public class AsyncBulkByScrollActionTests extends ESTestCase {
                 final int seqNo = randomInt(20);
                 final int primaryTerm = randomIntBetween(1, 16);
                 final IndexResponse response =
-                        new IndexResponse(shardId, "type", "id" + i, seqNo, primaryTerm, randomInt(), createdResponse);
+                        new IndexResponse(shardId, "id" + i, seqNo, primaryTerm, randomInt(), createdResponse);
                 responses[i] = new BulkItemResponse(i, opType, response);
             }
             assertExactlyOnce(onSuccess ->
@@ -549,7 +549,7 @@ public class AsyncBulkByScrollActionTests extends ESTestCase {
         DummyAsyncBulkByScrollAction action = new DummyActionWithoutBackoff();
         BulkRequest request = new BulkRequest();
         for (int i = 0; i < size + 1; i++) {
-            request.add(new IndexRequest("index", "type", "id" + i));
+            request.add(new IndexRequest("index").id("id" + i));
         }
         if (failWithRejection) {
             action.sendBulkRequest(request, Assert::fail);
@@ -876,7 +876,6 @@ public class AsyncBulkByScrollActionTests extends ESTestCase {
                         response =
                             new IndexResponse(
                                 shardId,
-                                index.type(),
                                 index.id() == null ? "dummy_id" : index.id(),
                                 randomInt(20),
                                 randomIntBetween(1, 16),
@@ -884,14 +883,13 @@ public class AsyncBulkByScrollActionTests extends ESTestCase {
                                 true);
                     } else if (item instanceof UpdateRequest) {
                         UpdateRequest update = (UpdateRequest) item;
-                        response = new UpdateResponse(shardId, update.type(), update.id(), randomNonNegativeLong(),
+                        response = new UpdateResponse(shardId, update.id(), randomNonNegativeLong(),
                             randomIntBetween(1, Integer.MAX_VALUE), randomIntBetween(0, Integer.MAX_VALUE), Result.CREATED);
                     } else if (item instanceof DeleteRequest) {
                         DeleteRequest delete = (DeleteRequest) item;
                         response =
                             new DeleteResponse(
                                 shardId,
-                                delete.type(),
                                 delete.id(),
                                 randomInt(20),
                                 randomIntBetween(1, 16),

+ 5 - 5
modules/reindex/src/test/java/org/elasticsearch/index/reindex/CancelTests.java

@@ -92,7 +92,7 @@ public class CancelTests extends ReindexTestCase {
 
         logger.debug("setting up [{}] docs", numDocs);
         indexRandom(true, false, true, IntStream.range(0, numDocs)
-                .mapToObj(i -> client().prepareIndex(INDEX, "_doc", String.valueOf(i)).setSource("n", i))
+                .mapToObj(i -> client().prepareIndex().setIndex(INDEX).setId(String.valueOf(i)).setSource("n", i))
                 .collect(Collectors.toList()));
 
         // Checks that the all documents have been indexed and correctly counted
@@ -208,12 +208,12 @@ public class CancelTests extends ReindexTestCase {
     }
 
     public void testReindexCancel() throws Exception {
-        testCancel(ReindexAction.NAME, reindex().source(INDEX).destination("dest", "_doc"), (response, total, modified) -> {
+        testCancel(ReindexAction.NAME, reindex().source(INDEX).destination("dest"), (response, total, modified) -> {
             assertThat(response, matcher().created(modified).reasonCancelled(equalTo("by user request")));
 
             refresh("dest");
             assertHitCount(client().prepareSearch("dest").setSize(0).get(), modified);
-        }, equalTo("reindex from [" + INDEX + "] to [dest][_doc]"));
+        }, equalTo("reindex from [" + INDEX + "] to [dest]"));
     }
 
     public void testUpdateByQueryCancel() throws Exception {
@@ -243,13 +243,13 @@ public class CancelTests extends ReindexTestCase {
 
     public void testReindexCancelWithWorkers() throws Exception {
         testCancel(ReindexAction.NAME,
-                reindex().source(INDEX).filter(QueryBuilders.matchAllQuery()).destination("dest", "_doc").setSlices(5),
+                reindex().source(INDEX).filter(QueryBuilders.matchAllQuery()).destination("dest").setSlices(5),
                 (response, total, modified) -> {
                     assertThat(response, matcher().created(modified).reasonCancelled(equalTo("by user request")).slices(hasSize(5)));
                     refresh("dest");
                     assertHitCount(client().prepareSearch("dest").setSize(0).get(), modified);
                 },
-                equalTo("reindex from [" + INDEX + "] to [dest][" + "_doc" + "]"));
+                equalTo("reindex from [" + INDEX + "] to [dest]"));
     }
 
     public void testUpdateByQueryCancelWithWorkers() throws Exception {

+ 0 - 22
modules/reindex/src/test/java/org/elasticsearch/index/reindex/RestReindexActionTests.java

@@ -24,7 +24,6 @@ import org.elasticsearch.common.bytes.BytesReference;
 import org.elasticsearch.common.xcontent.XContentBuilder;
 import org.elasticsearch.common.xcontent.XContentType;
 import org.elasticsearch.common.xcontent.json.JsonXContent;
-import org.elasticsearch.rest.RestRequest.Method;
 import org.elasticsearch.test.rest.FakeRestRequest;
 import org.elasticsearch.test.rest.RestActionTestCase;
 import org.junit.Before;
@@ -79,25 +78,4 @@ public class RestReindexActionTests extends RestActionTestCase {
             assertEquals("10m", request.getScrollTime().toString());
         }
     }
-
-    /**
-     * test deprecation is logged if a type is used in the destination index request inside reindex
-     */
-    public void testTypeInDestination() throws IOException {
-        FakeRestRequest.Builder requestBuilder = new FakeRestRequest.Builder(xContentRegistry())
-                .withMethod(Method.POST)
-                .withPath("/_reindex");
-        XContentBuilder b = JsonXContent.contentBuilder().startObject();
-        {
-            b.startObject("dest");
-            {
-                b.field("type", (randomBoolean() ? "_doc" : randomAlphaOfLength(4)));
-            }
-            b.endObject();
-        }
-        b.endObject();
-        requestBuilder.withContent(new BytesArray(BytesReference.bytes(b).toBytesRef()), XContentType.JSON);
-        dispatchRequest(requestBuilder.build());
-        assertWarnings(ReindexRequest.TYPES_DEPRECATION_MESSAGE);
-    }
 }

+ 0 - 2
modules/reindex/src/test/resources/rest-api-spec/test/delete_by_query/10_basic.yml

@@ -204,7 +204,6 @@
   - do:
       index:
         index:   test
-        type:    _doc
         id:      1
         body:    { "text": "test" }
   - do:
@@ -213,7 +212,6 @@
   - do:
       index:
         index:   test
-        type:    _doc
         id:      1
         body:    { "text": "test2" }
 

+ 0 - 2
modules/reindex/src/test/resources/rest-api-spec/test/update_by_query/10_basic.yml

@@ -162,7 +162,6 @@
   - do:
       index:
         index:   test
-        type:    _doc
         id:      1
         body:    { "text": "test" }
   - do:
@@ -171,7 +170,6 @@
   - do:
       index:
         index:   test
-        type:    _doc
         id:      1
         body:    { "text": "test2" }
 

+ 1 - 3
qa/mixed-cluster/src/test/java/org/elasticsearch/backwards/IndexingIT.java

@@ -28,7 +28,6 @@ import org.elasticsearch.common.Strings;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.xcontent.json.JsonXContent;
 import org.elasticsearch.index.seqno.SeqNoStats;
-import org.elasticsearch.rest.action.document.RestIndexAction;
 import org.elasticsearch.test.rest.ESRestTestCase;
 import org.elasticsearch.test.rest.yaml.ObjectPath;
 
@@ -46,9 +45,8 @@ public class IndexingIT extends ESRestTestCase {
     private int indexDocs(String index, final int idStart, final int numDocs) throws IOException {
         for (int i = 0; i < numDocs; i++) {
             final int id = idStart + i;
-            Request request = new Request("PUT", index + "/doc/" + id);
+            Request request = new Request("PUT", index + "/_doc/" + id);
             request.setJsonEntity("{\"test\": \"test_" + randomAlphaOfLength(2) + "\"}");
-            request.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
             assertOK(client().performRequest(request));
         }
         return numDocs;

+ 1 - 1
qa/os/bats/default/bootstrap_password.bash

@@ -128,7 +128,7 @@ SETUP_OK
 
 @test "[$GROUP] test elasticsearch-sql-cli" {
     password=$(grep "PASSWORD elastic = " /tmp/setup-passwords-output-with-bootstrap | sed "s/PASSWORD elastic = //")
-    curl -s -u "elastic:$password" -H "Content-Type: application/json" -XPUT 'localhost:9200/library/book/1?refresh&pretty' -d'{
+    curl -s -u "elastic:$password" -H "Content-Type: application/json" -XPUT 'localhost:9200/library/_doc/1?refresh&pretty' -d'{
             "name": "Ender'"'"'s Game",
             "author": "Orson Scott Card",
             "release_date": "1985-06-01",

+ 1 - 1
qa/os/bats/default/certgen.bash

@@ -382,7 +382,7 @@ DATA_SETTINGS
     testIndex=$(sudo curl -u "elastic:changeme" \
         -H "Content-Type: application/json" \
         --cacert "$ESCONFIG/certs/ca/ca.crt" \
-        -XPOST "https://127.0.0.1:9200/books/book/0?refresh" \
+        -XPOST "https://127.0.0.1:9200/books/_doc/0?refresh" \
         -d '{"title": "Elasticsearch The Definitive Guide"}')
 
     debug_collect_logs

+ 9 - 9
qa/os/bats/upgrade/80_upgrade.bats

@@ -78,21 +78,21 @@ setup() {
 }
 
 @test "[UPGRADE] index some documents into a few indexes" {
-    curl -s -H "Content-Type: application/json" -XPOST localhost:9200/library/book/1?pretty -d '{
+    curl -s -H "Content-Type: application/json" -XPOST localhost:9200/library/_doc/1?pretty -d '{
       "title": "Elasticsearch - The Definitive Guide"
     }'
-    curl -s -H "Content-Type: application/json" -XPOST localhost:9200/library/book/2?pretty -d '{
+    curl -s -H "Content-Type: application/json" -XPOST localhost:9200/library/_doc/2?pretty -d '{
       "title": "Brave New World"
     }'
-    curl -s -H "Content-Type: application/json" -XPOST localhost:9200/library2/book/1?pretty -d '{
+    curl -s -H "Content-Type: application/json" -XPOST localhost:9200/library2/_doc/1?pretty -d '{
       "title": "The Left Hand of Darkness"
     }'
 }
 
 @test "[UPGRADE] verify that the documents are there" {
-    curl -s localhost:9200/library/book/1?pretty | grep Elasticsearch
-    curl -s localhost:9200/library/book/2?pretty | grep World
-    curl -s localhost:9200/library2/book/1?pretty | grep Darkness
+    curl -s localhost:9200/library/_doc/1?pretty | grep Elasticsearch
+    curl -s localhost:9200/library/_doc/2?pretty | grep World
+    curl -s localhost:9200/library2/_doc/1?pretty | grep Darkness
 }
 
 @test "[UPGRADE] stop old version" {
@@ -117,9 +117,9 @@ setup() {
 }
 
 @test "[UPGRADE] verify that the documents are there after restart" {
-    curl -s localhost:9200/library/book/1?pretty | grep Elasticsearch
-    curl -s localhost:9200/library/book/2?pretty | grep World
-    curl -s localhost:9200/library2/book/1?pretty | grep Darkness
+    curl -s localhost:9200/library/_doc/1?pretty | grep Elasticsearch
+    curl -s localhost:9200/library/_doc/2?pretty | grep World
+    curl -s localhost:9200/library2/_doc/1?pretty | grep Darkness
 }
 
 @test "[UPGRADE] cleanup version under test" {

+ 2 - 2
qa/os/bats/utils/utils.bash

@@ -531,12 +531,12 @@ run_elasticsearch_tests() {
     [ "$status" -eq 0 ]
     echo "$output" | grep -w "green"
 
-    curl -s -H "Content-Type: application/json" -XPOST 'http://localhost:9200/library/book/1?refresh=true&pretty' -d '{
+    curl -s -H "Content-Type: application/json" -XPOST 'http://localhost:9200/library/_doc/1?refresh=true&pretty' -d '{
       "title": "Book #1",
       "pages": 123
     }'
 
-    curl -s -H "Content-Type: application/json" -XPOST 'http://localhost:9200/library/book/2?refresh=true&pretty' -d '{
+    curl -s -H "Content-Type: application/json" -XPOST 'http://localhost:9200/library/_doc/2?refresh=true&pretty' -d '{
       "title": "Book #2",
       "pages": 456
     }'

+ 2 - 2
qa/os/src/test/java/org/elasticsearch/packaging/util/ServerUtils.java

@@ -97,11 +97,11 @@ public class ServerUtils {
 
     public static void runElasticsearchTests() throws IOException {
         makeRequest(
-            Request.Post("http://localhost:9200/library/book/1?refresh=true&pretty")
+            Request.Post("http://localhost:9200/library/_doc/1?refresh=true&pretty")
                 .bodyString("{ \"title\": \"Book #1\", \"pages\": 123 }", ContentType.APPLICATION_JSON));
 
         makeRequest(
-            Request.Post("http://localhost:9200/library/book/2?refresh=true&pretty")
+            Request.Post("http://localhost:9200/library/_doc/2?refresh=true&pretty")
                 .bodyString("{ \"title\": \"Book #2\", \"pages\": 456 }", ContentType.APPLICATION_JSON));
 
         String count = makeRequest(Request.Get("http://localhost:9200/_count?pretty"));

+ 3 - 5
qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/RecoveryIT.java

@@ -33,7 +33,6 @@ import org.elasticsearch.common.util.concurrent.AbstractRunnable;
 import org.elasticsearch.common.xcontent.support.XContentMapValues;
 import org.elasticsearch.index.IndexSettings;
 import org.elasticsearch.index.seqno.RetentionLeaseUtils;
-import org.elasticsearch.rest.action.document.RestIndexAction;
 import org.elasticsearch.test.rest.yaml.ObjectPath;
 import org.hamcrest.Matchers;
 
@@ -49,7 +48,7 @@ import java.util.concurrent.Future;
 import java.util.concurrent.TimeUnit;
 import java.util.function.Predicate;
 
-import static com.carrotsearch.randomizedtesting.RandomizedTest.randomAsciiOfLength;
+import static com.carrotsearch.randomizedtesting.RandomizedTest.randomAsciiLettersOfLength;
 import static org.elasticsearch.cluster.routing.UnassignedInfo.INDEX_DELAYED_NODE_LEFT_TIMEOUT_SETTING;
 import static org.elasticsearch.cluster.routing.allocation.decider.EnableAllocationDecider.INDEX_ROUTING_ALLOCATION_ENABLE_SETTING;
 import static org.elasticsearch.cluster.routing.allocation.decider.MaxRetryAllocationDecider.SETTING_ALLOCATION_MAX_RETRY;
@@ -104,9 +103,8 @@ public class RecoveryIT extends AbstractRollingTestCase {
     private int indexDocs(String index, final int idStart, final int numDocs) throws IOException {
         for (int i = 0; i < numDocs; i++) {
             final int id = idStart + i;
-            Request indexDoc = new Request("PUT", index + "/test/" + id);
-            indexDoc.setJsonEntity("{\"test\": \"test_" + randomAsciiOfLength(2) + "\"}");
-            indexDoc.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE));
+            Request indexDoc = new Request("PUT", index + "/_doc/" + id);
+            indexDoc.setJsonEntity("{\"test\": \"test_" + randomAsciiLettersOfLength(2) + "\"}");
             client().performRequest(indexDoc);
         }
         return numDocs;

+ 0 - 1
qa/smoke-test-ingest-disabled/src/test/resources/rest-api-spec/test/ingest_mustache/10_ingest_disabled.yml

@@ -73,7 +73,6 @@
       catch: /There are no ingest nodes in this cluster, unable to forward request to an ingest node./
       index:
         index: test
-        type: test
         id: 1
         pipeline: "my_pipeline_1"
         body: {

+ 4 - 4
qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/ingest/IngestDocumentMustacheIT.java

@@ -33,7 +33,7 @@ public class IngestDocumentMustacheIT extends AbstractScriptTestCase {
     public void testAccessMetaDataViaTemplate() {
         Map<String, Object> document = new HashMap<>();
         document.put("foo", "bar");
-        IngestDocument ingestDocument = new IngestDocument("index", "type", "id", null, null, null, document);
+        IngestDocument ingestDocument = new IngestDocument("index", "id", null, null, null, document);
         ingestDocument.setFieldValue(compile("field1"), ValueSource.wrap("1 {{foo}}", scriptService));
         assertThat(ingestDocument.getFieldValue("field1", String.class), equalTo("1 bar"));
 
@@ -48,7 +48,7 @@ public class IngestDocumentMustacheIT extends AbstractScriptTestCase {
         innerObject.put("baz", "hello baz");
         innerObject.put("qux", Collections.singletonMap("fubar", "hello qux and fubar"));
         document.put("foo", innerObject);
-        IngestDocument ingestDocument = new IngestDocument("index", "type", "id", null, null, null, document);
+        IngestDocument ingestDocument = new IngestDocument("index", "id", null, null, null, document);
         ingestDocument.setFieldValue(compile("field1"),
                 ValueSource.wrap("1 {{foo.bar}} {{foo.baz}} {{foo.qux.fubar}}", scriptService));
         assertThat(ingestDocument.getFieldValue("field1", String.class), equalTo("1 hello bar hello baz hello qux and fubar"));
@@ -67,7 +67,7 @@ public class IngestDocumentMustacheIT extends AbstractScriptTestCase {
         list.add(value);
         list.add(null);
         document.put("list2", list);
-        IngestDocument ingestDocument = new IngestDocument("index", "type", "id", null, null, null, document);
+        IngestDocument ingestDocument = new IngestDocument("index", "id", null, null, null, document);
         ingestDocument.setFieldValue(compile("field1"), ValueSource.wrap("1 {{list1.0}} {{list2.0}}", scriptService));
         assertThat(ingestDocument.getFieldValue("field1", String.class), equalTo("1 foo {field=value}"));
     }
@@ -77,7 +77,7 @@ public class IngestDocumentMustacheIT extends AbstractScriptTestCase {
         Map<String, Object> ingestMap = new HashMap<>();
         ingestMap.put("timestamp", "bogus_timestamp");
         document.put("_ingest", ingestMap);
-        IngestDocument ingestDocument = new IngestDocument("index", "type", "id", null, null, null, document);
+        IngestDocument ingestDocument = new IngestDocument("index", "id", null, null, null, document);
         ingestDocument.setFieldValue(compile("ingest_timestamp"),
                 ValueSource.wrap("{{_ingest.timestamp}} and {{_source._ingest.timestamp}}", scriptService));
         assertThat(ingestDocument.getFieldValue("ingest_timestamp", String.class),

+ 1 - 1
qa/smoke-test-ingest-with-all-dependencies/src/test/java/org/elasticsearch/ingest/ValueSourceMustacheIT.java

@@ -64,7 +64,7 @@ public class ValueSourceMustacheIT extends AbstractScriptTestCase {
     }
 
     public void testAccessSourceViaTemplate() {
-        IngestDocument ingestDocument = new IngestDocument("marvel", "type", "id", null, null, null, new HashMap<>());
+        IngestDocument ingestDocument = new IngestDocument("marvel", "id", null, null, null, new HashMap<>());
         assertThat(ingestDocument.hasField("marvel"), is(false));
         ingestDocument.setFieldValue(compile("{{_index}}"), ValueSource.wrap("{{_index}}", scriptService));
         assertThat(ingestDocument.getFieldValue("marvel", String.class), equalTo("marvel"));

+ 4 - 10
qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/10_pipeline_with_mustache_templates.yml

@@ -14,13 +14,13 @@
               {
                 "set" : {
                   "field" : "index_type_id",
-                  "value": "{{_index}}/{{_type}}/{{_id}}"
+                  "value": "{{_index}}/{{_id}}"
                 }
               },
               {
                 "append" : {
                   "field" : "metadata",
-                  "value": ["{{_index}}", "{{_type}}", "{{_id}}"]
+                  "value": ["{{_index}}", "{{_id}}"]
                 }
               }
             ]
@@ -30,7 +30,6 @@
   - do:
       index:
         index: test
-        type: test
         id: 1
         pipeline: "my_pipeline_1"
         body: {}
@@ -40,8 +39,8 @@
         index: test
         id: 1
   - length: { _source: 2 }
-  - match: { _source.index_type_id: "test/test/1" }
-  - match: { _source.metadata: ["test", "test", "1"] }
+  - match: { _source.index_type_id: "test/1" }
+  - match: { _source.metadata: ["test", "1"] }
 
 ---
 "Test templating":
@@ -109,7 +108,6 @@
   - do:
       index:
         index: test
-        type: test
         id: 1
         pipeline: "my_pipeline_1"
         body: {
@@ -133,7 +131,6 @@
   - do:
       index:
         index: test
-        type: test
         id: 1
         pipeline: "my_pipeline_2"
         body: {
@@ -151,7 +148,6 @@
   - do:
       index:
         index: test
-        type: test
         id: 1
         pipeline: "my_pipeline_3"
         body: {
@@ -200,7 +196,6 @@
   - do:
       index:
         index: test
-        type: test
         id: 1
         pipeline: "my_handled_pipeline"
         body: {
@@ -241,7 +236,6 @@
   - do:
       index:
         index: test
-        type: test
         id: 1
         pipeline: "_id"
         body: {

+ 0 - 2
qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/20_combine_processors.yml

@@ -43,7 +43,6 @@
   - do:
       index:
         index: test
-        type: test
         id: 1
         pipeline: "_id"
         body: {
@@ -131,7 +130,6 @@
   - do:
       index:
         index: test
-        type: test
         id: 1
         pipeline: "_id"
         body: {

+ 0 - 1
qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/30_update_by_query_with_ingest.yml

@@ -18,7 +18,6 @@
   - do:
       index:
         index:  twitter
-        type:   _doc
         id:     1
         body:   { "user": "kimchy" }
   - do:

+ 0 - 1
qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/40_reindex_with_ingest.yml

@@ -18,7 +18,6 @@
   - do:
       index:
         index:  twitter
-        type:   tweet
         id:     1
         body:   { "user": "kimchy" }
   - do:

+ 0 - 2
qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/50_script_processor_using_painless.yml

@@ -22,7 +22,6 @@
   - do:
       index:
         index: test
-        type: test
         id: 1
         pipeline: "my_pipeline"
         body: { bytes_in: 1234, bytes_out: 4321 }
@@ -71,7 +70,6 @@
   - do:
       index:
         index: test
-        type: test
         id: 1
         pipeline: "my_pipeline"
         body: { bytes_in: 1234, bytes_out: 4321 }

+ 0 - 47
rest-api-spec/src/main/resources/rest-api-spec/api/index.json

@@ -35,53 +35,6 @@
               "description":"The name of the index"
             }
           }
-        },
-        {
-          "path":"/{index}/{type}",
-          "methods":[
-            "POST"
-          ],
-          "parts":{
-            "index":{
-              "type":"string",
-              "description":"The name of the index"
-            },
-            "type":{
-              "type":"string",
-              "description":"The type of the document",
-              "deprecated":true
-            }
-          },
-          "deprecated":{
-            "version":"7.0.0",
-            "description":"Specifying types in urls has been deprecated"
-          }
-        },
-        {
-          "path":"/{index}/{type}/{id}",
-          "methods":[
-            "PUT",
-            "POST"
-          ],
-          "parts":{
-            "id":{
-              "type":"string",
-              "description":"Document ID"
-            },
-            "index":{
-              "type":"string",
-              "description":"The name of the index"
-            },
-            "type":{
-              "type":"string",
-              "description":"The type of the document",
-              "deprecated":true
-            }
-          },
-          "deprecated":{
-            "version":"7.0.0",
-            "description":"Specifying types in urls has been deprecated"
-          }
         }
       ]
     },

+ 0 - 31
rest-api-spec/src/main/resources/rest-api-spec/test/create/11_with_id_with_types.yml

@@ -1,31 +0,0 @@
----
-"Create with ID":
- - do:
-      create:
-          index:  test_1
-          type:   test
-          id:     1
-          body:   { foo: bar }
-
- - match:   { _index:   test_1 }
- - match:   { _type:    test }
- - match:   { _id:      "1"}
- - match:   { _version: 1}
-
- - do:
-      get:
-          index:  test_1
-          id:     1
-
- - match:   { _index:   test_1 }
- - match:   { _id:      "1"}
- - match:   { _version: 1}
- - match:   { _source: { foo: bar }}
-
- - do:
-      catch:      conflict
-      create:
-          index:  test_1
-          type:   test
-          id:     1
-          body:   { foo: bar }

+ 0 - 8
rest-api-spec/src/main/resources/rest-api-spec/test/create/15_without_id_with_types.yml

@@ -1,8 +0,0 @@
----
-"Create without ID":
- - do:
-      catch: param
-      create:
-          index:  test_1
-          type:   test
-          body:   { foo: bar }

+ 0 - 30
rest-api-spec/src/main/resources/rest-api-spec/test/create/36_external_version_with_types.yml

@@ -1,30 +0,0 @@
----
-"External version":
-
- - do:
-      catch:              bad_request
-      create:
-          index:          test
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external
-          version:        0
-
- - match: { status: 400 }
- - match: { error.type: action_request_validation_exception }
- - match: { error.reason: "Validation Failed: 1: create operations only support internal versioning. use index instead;" }
-
- - do:
-      catch:              bad_request
-      create:
-          index:          test
-          type:           test
-          id:             2
-          body:           { foo: bar }
-          version_type:   external
-          version:        5
-
- - match: { status: 400 }
- - match: { error.type: action_request_validation_exception }
- - match: { error.reason: "Validation Failed: 1: create operations only support internal versioning. use index instead;" }

+ 0 - 41
rest-api-spec/src/main/resources/rest-api-spec/test/create/41_routing_with_types.yml

@@ -1,41 +0,0 @@
----
-"Routing":
-
- - do:
-     indices.create:
-       index:    test_1
-       body:
-         settings:
-           index:
-             number_of_shards: 5
-             number_of_routing_shards: 5
-             number_of_replicas: 0
-
- - do:
-      cluster.health:
-          wait_for_status: green
-
- - do:
-      create:
-          index:   test_1
-          type:    test
-          id:      1
-          routing: 5
-          body:    { foo: bar }
-
- - do:
-      get:
-          index:   test_1
-          id:      1
-          routing: 5
-          stored_fields:  [_routing]
-
- - match:   { _id:              "1"}
- - match:   { _routing:  "5"}
-
- - do:
-      catch: missing
-      get:
-          index:   test_1
-          id:      1
-

+ 0 - 82
rest-api-spec/src/main/resources/rest-api-spec/test/create/61_refresh_with_types.yml

@@ -1,82 +0,0 @@
----
-"Refresh":
-
- - do:
-      indices.create:
-          index:    test_1
-          body:
-              settings:
-                  index.refresh_interval: -1
-                  number_of_replicas: 0
- - do:
-      create:
-          index:   test_1
-          type:    test
-          id:      1
-          body:    { foo: bar }
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { term: { _id: 1 }}
-
- - match: { hits.total: 0 }
-
- - do:
-      create:
-          index:   test_1
-          type:    test
-          id:      2
-          refresh: true
-          body:    { foo: bar }
- - is_true: forced_refresh
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { term: { _id: 2 }}
-
- - match: { hits.total: 1 }
-
----
-"When refresh url parameter is an empty string that means \"refresh immediately\"":
- - do:
-      create:
-          index:   test_1
-          type:    test
-          id:      1
-          refresh: ""
-          body:    { foo: bar }
- - is_true: forced_refresh
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { term: { _id: 1 }}
-
- - match: { hits.total: 1 }
-
----
-"refresh=wait_for waits until changes are visible in search":
- - do:
-      index:
-          index:   create_60_refresh_1
-          type:    test
-          id:      create_60_refresh_id1
-          body:    { foo: bar }
-          refresh: wait_for
- - is_false: forced_refresh
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   create_60_refresh_1
-          body:
-            query:   { term: { _id: create_60_refresh_id1 }}
- - match: { hits.total: 1 }

+ 0 - 38
rest-api-spec/src/main/resources/rest-api-spec/test/create/71_nested_with_types.yml

@@ -1,38 +0,0 @@
----
-setup:
-  - do:
-      indices.create:
-          include_type_name: true
-          index: test_1
-          body:
-              settings:
-                  index.mapping.nested_objects.limit: 2
-              mappings:
-                  test_type:
-                      properties:
-                          nested1:
-                              type: nested
-
----
-"Indexing a doc with No. nested objects less or equal to index.mapping.nested_objects.limit should succeed":
-
-  - do:
-      create:
-          index:  test_1
-          type:   test_type
-          id:     1
-          body:
-              "nested1" : [ { "foo": "bar" }, { "foo": "bar2" } ]
-  - match:   { _version: 1}
-
----
-"Indexing a doc with No. nested objects more than index.mapping.nested_objects.limit should fail":
-
-  - do:
-      catch: /The number of nested documents has exceeded the allowed limit of \[2\]. This limit can be set by changing the \[index.mapping.nested_objects.limit\] index level setting\./
-      create:
-          index:  test_1
-          type:   test_type
-          id:     1
-          body:
-              "nested1" : [ { "foo": "bar" }, { "foo": "bar2" }, { "foo": "bar3" } ]

+ 0 - 1
rest-api-spec/src/main/resources/rest-api-spec/test/delete/11_shard_header.yml

@@ -27,7 +27,6 @@
            id:     1
 
  - match:   { _index:   foobar }
- - match:   { _type: _doc }
  - match:   { _id:      "1"}
  - match:   { _version: 2}
  - match:   { _shards.total: 1}

+ 0 - 19
rest-api-spec/src/main/resources/rest-api-spec/test/delete/13_basic_with_types.yml

@@ -1,19 +0,0 @@
----
-"Basic":
-
- - do:
-      index:
-          index:  test_1
-          type:   test
-          id:     1
-          body:   { foo: bar }
-
- - match:   { _version: 1 }
-
- - do:
-      delete:
-          index:  test_1
-          type:   test
-          id:     1
-
- - match:   { _version: 2 }

+ 0 - 36
rest-api-spec/src/main/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml

@@ -1,36 +0,0 @@
----
-"Delete check shard header":
-
- - do:
-      indices.create:
-        index: foobar
-        body:
-          settings:
-            number_of_shards: "1"
-            number_of_replicas: "0"
-
- - do:
-      cluster.health:
-          wait_for_status: green
-
- - do:
-      index:
-          index:  foobar
-          type:   baz
-          id:     1
-          body:   { foo: bar }
-
- - do:
-       delete:
-           index:  foobar
-           type:   baz
-           id:     1
-
- - match:   { _index:   foobar }
- - match:   { _type:    baz }
- - match:   { _id:      "1"}
- - match:   { _version: 2}
- - match:   { _shards.total: 1}
- - match:   { _shards.successful: 1}
- - match:   { _shards.failed: 0}
- - is_false:   _shards.pending

+ 0 - 26
rest-api-spec/src/main/resources/rest-api-spec/test/delete/15_result_with_types.yml

@@ -1,26 +0,0 @@
----
-"Delete result field":
-
- - do:
-      index:
-          index:   test_1
-          type:    test
-          id:      1
-          body:    { foo: bar }
-
- - do:
-      delete:
-          index:   test_1
-          type:    test
-          id:      1
-
- - match: { result: deleted }
-
- - do:
-      catch: missing
-      delete:
-          index:   test_1
-          type:    test
-          id:      1
-
- - match: { result: not_found }

+ 0 - 30
rest-api-spec/src/main/resources/rest-api-spec/test/delete/21_cas_with_types.yml

@@ -1,30 +0,0 @@
----
-"Internal version":
-
-  - do:
-      index:
-        index:   test_1
-        type:    test
-        id:      1
-        body:    { foo: bar }
-
-  - match:   { _seq_no: 0 }
-
-  - do:
-      catch:       conflict
-      delete:
-        index:   test_1
-        type:    test
-        id:      1
-        if_seq_no: 2
-        if_primary_term: 1
-
-  - do:
-      delete:
-        index:   test_1
-        type:    test
-        id:      1
-        if_seq_no: 0
-        if_primary_term: 1
-
-  - match: { _seq_no: 1 }

+ 0 - 32
rest-api-spec/src/main/resources/rest-api-spec/test/delete/27_external_version_with_types.yml

@@ -1,32 +0,0 @@
----
-"External version":
-
- - do:
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external
-          version:        5
-
- - match:   { _version: 5}
-
- - do:
-      catch:             conflict
-      delete:
-          index:          test_1
-          type:           test
-          id:             1
-          version_type:   external
-          version:        4
-
- - do:
-      delete:
-          index:          test_1
-          type:           test
-          id:             1
-          version_type:   external
-          version:        6
-
- - match:   { _version: 6}

+ 0 - 53
rest-api-spec/src/main/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml

@@ -1,53 +0,0 @@
----
-"External GTE version":
-
- - do:
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external_gte
-          version:        5
-
- - match:   { _version: 5}
-
- - do:
-      catch:             conflict
-      delete:
-          index:          test_1
-          type:           test
-          id:             1
-          version_type:   external_gte
-          version:        4
-
- - do:
-      delete:
-          index:          test_1
-          type:           test
-          id:             1
-          version_type:   external_gte
-          version:        6
-
- - match:   { _version: 6}
-
- - do:
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external_gte
-          version:        6
-
- - match:   { _version: 6}
-
- - do:
-      delete:
-          index:          test_1
-          type:           test
-          id:             1
-          version_type:   external_gte
-          version:        6
-
- - match:   { _version: 6}

+ 0 - 32
rest-api-spec/src/main/resources/rest-api-spec/test/delete/31_routing_with_types.yml

@@ -1,32 +0,0 @@
----
-"Routing":
-
- - do:
-      indices.create:
-          index: test_1
-          body:
-            settings:
-              number_of_shards: 5
- - do:
-      index:
-          index:   test_1
-          type:    test
-          id:      1
-          routing: 5
-          body:    { foo: bar }
-
- - do:
-      catch:      missing
-      delete:
-          index:   test_1
-          type:    test
-          id:      1
-          routing: 4
-
- - do:
-      delete:
-          index:   test_1
-          type:    test
-          id:      1
-          routing: 5
-

+ 0 - 148
rest-api-spec/src/main/resources/rest-api-spec/test/delete/51_refresh_with_types.yml

@@ -1,148 +0,0 @@
----
-"Refresh":
-
- - do:
-      indices.create:
-          index:    test_1
-          body:
-              settings:
-                  refresh_interval: -1
-                  number_of_shards: 5
-                  number_of_routing_shards: 5
-                  number_of_replicas: 0
- - do:
-      cluster.health:
-          wait_for_status: green
-
- - do:
-      index:
-          index:   test_1
-          type:    test
-          id:      1
-          body:    { foo: bar }
-          refresh: true
-
-# If you wonder why this document get 3 as an id instead of 2, it is because the
-# current routing algorithm would route 1 and 2 to the same shard while we need
-# them to be different for this test to pass
- - do:
-      index:
-          index:   test_1
-          type:    test
-          id:      3
-          body:    { foo: bar }
-          refresh: true
- - is_true: forced_refresh
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { terms: { _id: [1,3] }}
-
- - match: { hits.total: 2 }
-
- - do:
-      delete:
-          index:   test_1
-          type:    test
-          id:      1
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { terms: { _id: [1,3] }}
-
- - match: { hits.total: 2 }
-
- - do:
-      delete:
-          index:   test_1
-          type:    test
-          id:      3
-          refresh: true
-
-# If a replica shard where doc 1 is located gets initialized at this point, doc 1
-# won't be found by the following search as the shard gets automatically refreshed
-# right before getting started. This is why this test only works with 0 replicas.
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { terms: { _id: [1,3] }}
-
- - match: { hits.total: 1 }
-
----
-"When refresh url parameter is an empty string that means \"refresh immediately\"":
- - do:
-      index:
-          index:   test_1
-          type:    test
-          id:      1
-          body:    { foo: bar }
-          refresh: true
- - is_true: forced_refresh
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { term: { _id: 1 }}
- - match: { hits.total: 1 }
-
- - do:
-      delete:
-          index:   test_1
-          type:    test
-          id:      1
-          refresh: ""
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { term: { _id: 1 }}
- - match: { hits.total: 0 }
-
----
-"refresh=wait_for waits until changes are visible in search":
- - do:
-      index:
-          index:   delete_50_refresh_1
-          type:    test
-          id:      delete_50_refresh_id1
-          body:    { foo: bar }
-          refresh: true
- - is_true: forced_refresh
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   delete_50_refresh_1
-          body:
-            query:   { term: { _id: delete_50_refresh_id1 }}
- - match: { hits.total: 1 }
-
- - do:
-     delete:
-         index:   delete_50_refresh_1
-         type:    test
-         id:      delete_50_refresh_id1
-         refresh: wait_for
- - is_false: forced_refresh
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   delete_50_refresh_1
-          body:
-            query:   { term: { _id: delete_50_refresh_id1 }}
- - match: { hits.total: 0 }

+ 0 - 19
rest-api-spec/src/main/resources/rest-api-spec/test/delete/61_missing_with_types.yml

@@ -1,19 +0,0 @@
----
-"Missing document with catch":
-
- - do:
-      catch:      missing
-      delete:
-          index:  test_1
-          type:   test
-          id:     1
-
----
-"Missing document with ignore":
-
- - do:
-      delete:
-          index:  test_1
-          type:   test
-          id:     1
-          ignore: 404

+ 0 - 30
rest-api-spec/src/main/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml

@@ -1,30 +0,0 @@
----
-"DELETE with typeless API on an index that has types":
-
- - do:
-      indices.create: # not using include_type_name: false on purpose
-          include_type_name: true
-          index: index
-          body:
-              mappings:
-                  not_doc:
-                      properties:
-                          foo:
-                              type: "keyword"
-
- - do:
-      index:
-          index:  index
-          type:   not_doc
-          id:     1
-          body:   { foo: bar }
-
- - do:
-      delete:
-          index:  index
-          id:     1
-
- - match:   { _index:   "index" }
- - match:   { _type:    "_doc" }
- - match:   { _id:      "1"}
- - match:   { _version: 2}

+ 0 - 1
rest-api-spec/src/main/resources/rest-api-spec/test/index/10_with_id.yml

@@ -10,7 +10,6 @@
           body:   { foo: bar }
 
  - match:   { _index:   test-weird-index-中文 }
- - match:   { _type: _doc }
  - match:   { _id:      "1"}
  - match:   { _version: 1}
 

+ 0 - 32
rest-api-spec/src/main/resources/rest-api-spec/test/index/11_with_id_with_types.yml

@@ -1,32 +0,0 @@
----
-"Index with ID":
-
- - do:
-      index:
-          index:  test-weird-index-中文
-          type:   weird.type
-          id:     1
-          body:   { foo: bar }
-
- - match:   { _index:   test-weird-index-中文 }
- - match:   { _type:    weird.type }
- - match:   { _id:      "1"}
- - match:   { _version: 1}
-
- - do:
-      get:
-          index:  test-weird-index-中文
-          id:     1
-
- - match:   { _index:   test-weird-index-中文 }
- - match:   { _id:      "1"}
- - match:   { _version: 1}
- - match:   { _source: { foo: bar }}
-
- - do:
-      catch: bad_request
-      index:
-          index:  idx
-          type:   type
-          id:     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-          body:   { foo: bar }

+ 0 - 21
rest-api-spec/src/main/resources/rest-api-spec/test/index/13_result_with_types.yml

@@ -1,21 +0,0 @@
----
-"Index result field":
-
-  - do:
-      index:
-          index:  test_index
-          type:   test
-          id:     1
-          body:   { foo: bar }
-
-  - match:   { result: created }
-
-  - do:
-      index:
-          index:    test_index
-          type:     test
-          id:       1
-          body:     { foo: bar }
-          op_type:  index
-
-  - match:   { result: updated }

+ 0 - 1
rest-api-spec/src/main/resources/rest-api-spec/test/index/15_without_id.yml

@@ -10,7 +10,6 @@
 
  - is_true:   _id
  - match:   { _index:   test_1 }
- - match:   { _type: _doc }
  - match:   { _version: 1      }
  - set:     { _id:      id    }
 

+ 0 - 24
rest-api-spec/src/main/resources/rest-api-spec/test/index/16_without_id_with_types.yml

@@ -1,24 +0,0 @@
----
-"Index without ID":
-
- - do:
-      index:
-          index:  test_1
-          type:   test
-          body:   { foo: bar }
-
- - is_true:   _id
- - match:   { _index:   test_1 }
- - match:   { _type:    test   }
- - match:   { _version: 1      }
- - set:     { _id:      id    }
-
- - do:
-      get:
-          index:  test_1
-          id:     '$id'
-
- - match:   { _index:   test_1 }
- - match:   { _id:      $id    }
- - match:   { _version: 1      }
- - match:   { _source: { foo: bar }}

+ 0 - 29
rest-api-spec/src/main/resources/rest-api-spec/test/index/21_optype_with_types.yml

@@ -1,29 +0,0 @@
----
-"Optype":
-
- - do:
-      index:
-          index:    test_1
-          type:     test
-          id:       1
-          op_type:  create
-          body:   { foo: bar }
-
- - do:
-      catch:      conflict
-      index:
-          index:    test_1
-          type:     test
-          id:       1
-          op_type:  create
-          body:   { foo: bar }
-
- - do:
-      index:
-          index:    test_1
-          type:     test
-          id:       1
-          op_type:  index
-          body:   { foo: bar }
-
- - match: { _version: 2 }

+ 0 - 55
rest-api-spec/src/main/resources/rest-api-spec/test/index/37_external_version_with_types.yml

@@ -1,55 +0,0 @@
----
-"External version":
-
- - do:
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external
-          version:        0
-
- - match:   { _version: 0 }
-
- - do:
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external
-          version:        5
-
- - match:   { _version: 5 }
-
- - do:
-      catch:             conflict
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external
-          version:        5
-
- - do:
-      catch:             conflict
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external
-          version:        0
-
- - do:
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external
-          version:        6
-
- - match:   { _version: 6}

+ 0 - 56
rest-api-spec/src/main/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml

@@ -1,56 +0,0 @@
----
-"External GTE version":
-
- - do:
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external_gte
-          version:        0
-
- - match:   { _version: 0}
-
- - do:
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external_gte
-          version:        5
-
- - match:   { _version: 5}
-
- - do:
-      catch:             conflict
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar }
-          version_type:   external_gte
-          version:        0
-
- - do:
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar2 }
-          version_type:   external_gte
-          version:        5
-
- - match:   { _version: 5}
-
- - do:
-      index:
-          index:          test_1
-          type:           test
-          id:             1
-          body:           { foo: bar2 }
-          version_type:   external_gte
-          version:        6
-
- - match:   { _version: 6}

+ 0 - 41
rest-api-spec/src/main/resources/rest-api-spec/test/index/41_routing_with_types.yml

@@ -1,41 +0,0 @@
----
-"Routing":
-
- - do:
-     indices.create:
-       index:    test_1
-       body:
-         settings:
-           index:
-             number_of_shards: 5
-             number_of_routing_shards: 5
-             number_of_replicas: 0
-
- - do:
-      cluster.health:
-          wait_for_status: green
-
- - do:
-      index:
-          index:   test_1
-          type:    test
-          id:      1
-          routing: 5
-          body:    { foo: bar }
-
- - do:
-      get:
-          index:   test_1
-          id:      1
-          routing: 5
-          stored_fields:  [_routing]
-
- - match:   { _id:       "1"}
- - match:   { _routing:  "5"}
-
- - do:
-      catch: missing
-      get:
-          index:   test_1
-          id:      1
-

+ 0 - 83
rest-api-spec/src/main/resources/rest-api-spec/test/index/61_refresh_with_types.yml

@@ -1,83 +0,0 @@
----
-"Refresh":
-
- - do:
-      indices.create:
-          index:    test_1
-          body:
-              settings:
-                  index.refresh_interval: -1
-                  number_of_replicas: 0
-
- - do:
-      index:
-          index:   test_1
-          type:    test
-          id:      1
-          body:    { foo: bar }
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { term: { _id: 1 }}
-
- - match: { hits.total: 0 }
-
- - do:
-      index:
-          index:   test_1
-          type:    test
-          id:      2
-          refresh: true
-          body:    { foo: bar }
- - is_true: forced_refresh
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { term: { _id: 2 }}
-
- - match: { hits.total: 1 }
-
----
-"When refresh url parameter is an empty string that means \"refresh immediately\"":
- - do:
-      index:
-          index:   test_1
-          type:    test
-          id:      1
-          refresh: ""
-          body:    { foo: bar }
- - is_true: forced_refresh
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   test_1
-          body:
-            query:   { term: { _id: 1 }}
-
- - match: { hits.total: 1 }
-
----
-"refresh=wait_for waits until changes are visible in search":
- - do:
-      index:
-          index:   index_60_refresh_1
-          type:    test
-          id:      index_60_refresh_id1
-          body:    { foo: bar }
-          refresh: wait_for
- - is_false: forced_refresh
-
- - do:
-      search:
-          rest_total_hits_as_int: true
-          index:   index_60_refresh_1
-          body:
-            query:   { term: { _id: index_60_refresh_id1 }}
- - match: { hits.total: 1 }

+ 0 - 1
rest-api-spec/src/main/resources/rest-api-spec/test/indices.flush/10_basic.yml

@@ -42,7 +42,6 @@
   - do:
       index:
         index: test
-        type:  doc
         id:    1
         body:  { "message": "a long message to make a periodic flush happen after this index operation" }
   - do:

+ 0 - 2
rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml

@@ -16,7 +16,6 @@
   - do:
       index:
         index: logs-1
-        type:  test
         id:    "1"
         body:  { "foo": "hello world" }
         # make this doc visible in index stats
@@ -57,7 +56,6 @@
   - do:
       index:
         index: logs-000002
-        type:  test
         id:    "2"
         body:  { "foo": "hello world" }
 

+ 0 - 2
rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml

@@ -14,7 +14,6 @@
   - do:
       index:
         index: logs-1
-        type:  test
         id:    "1"
         body:  { "foo": "hello world" }
         refresh: true
@@ -35,7 +34,6 @@
   - do:
       index:
         index: logs-1
-        type:  test
         id:    "2"
         body:  { "foo": "hello world" }
         refresh: true

+ 0 - 1
rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml

@@ -14,7 +14,6 @@
   - do:
       index:
         index: logs-1
-        type:  doc
         id:    "1"
         body:  { "foo": "hello world" }
         refresh: true

+ 0 - 44
rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml

@@ -1,44 +0,0 @@
----
-"Typeless mapping":
-
-  - do:
-      indices.create:
-        index: logs-1
-        body:
-          aliases:
-            logs_search: {}
-
-  # index first document and wait for refresh
-  - do:
-      index:
-        index: logs-1
-        type:  test
-        id:    "1"
-        body:  { "foo": "hello world" }
-        refresh: true
-
-  # index second document and wait for refresh
-  - do:
-      index:
-        index: logs-1
-        type:  test
-        id:    "2"
-        body:  { "foo": "hello world" }
-        refresh: true
-
-  # perform alias rollover with new typeless mapping
-  - do:
-      indices.rollover:
-        include_type_name: true
-        alias: "logs_search"
-        body:
-          conditions:
-            max_docs: 2
-          mappings:
-            _doc:
-              properties:
-                foo2:
-                  type: keyword
-
-  - match: { conditions: { "[max_docs: 2]": true } }
-  - match: { rolled_over: true }

+ 0 - 2
rest-api-spec/src/main/resources/rest-api-spec/test/indices.segments/10_basic.yml

@@ -25,7 +25,6 @@
   - do:
       index:
         index: index1
-        type: type
         body: { foo: bar }
         refresh: true
 
@@ -53,7 +52,6 @@
   - do:
       index:
         index: index1
-        type: type
         body: { foo: bar }
         refresh: true
 

+ 0 - 3
rest-api-spec/src/main/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml

@@ -24,7 +24,6 @@
   - do:
       index:
         index: index1
-        type: type
         body: { foo: bar }
         refresh: true
 
@@ -59,13 +58,11 @@
   - do:
       index:
         index: index1
-        type: type
         body: { foo: bar }
         refresh: true
   - do:
       index:
         index: index2
-        type: type
         body: { foo: bar }
         refresh: true
   - do:

+ 0 - 2
rest-api-spec/src/main/resources/rest-api-spec/test/search/300_sequence_numbers.yml

@@ -6,7 +6,6 @@ setup:
   - do:
       index:
           index:  test_1
-          type:   test
           id:     1
           body:   { foo: foo }
 
@@ -14,7 +13,6 @@ setup:
   - do:
       index:
         index:  test_1
-        type:   test
         id:     1
         body:   { foo: bar }
 

部分文件因为文件数量过多而无法显示