ソースを参照

Remove include_type_name from the relevant APIs. (#35192)

We've decided that the bulk, delete, get, index, update, and search APIs should not
contain this request parameter, and we will instead accept both typed and typeless calls.
Julie Tibshirani 7 年 前
コミット
ec53288fc0
63 ファイル変更101 行追加430 行削除
  1. 6 5
      docs/reference/mapping/removal_of_types.asciidoc
  2. 0 4
      rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json
  3. 0 4
      rest-api-spec/src/main/resources/rest-api-spec/api/delete.json
  4. 0 4
      rest-api-spec/src/main/resources/rest-api-spec/api/get.json
  5. 0 4
      rest-api-spec/src/main/resources/rest-api-spec/api/index.json
  6. 0 4
      rest-api-spec/src/main/resources/rest-api-spec/api/search.json
  7. 0 4
      rest-api-spec/src/main/resources/rest-api-spec/api/update.json
  8. 3 6
      rest-api-spec/src/main/resources/rest-api-spec/test/bulk/10_basic.yml
  9. 1 3
      rest-api-spec/src/main/resources/rest-api-spec/test/bulk/20_list_of_strings.yml
  10. 1 3
      rest-api-spec/src/main/resources/rest-api-spec/test/bulk/30_big_string.yml
  11. 1 9
      rest-api-spec/src/main/resources/rest-api-spec/test/bulk/40_source.yml
  12. 3 9
      rest-api-spec/src/main/resources/rest-api-spec/test/bulk/50_refresh.yml
  13. 1 11
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/10_basic.yml
  14. 2 4
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/11_shard_header.yml
  15. 1 4
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/12_result.yml
  16. 1 4
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/20_internal_version.yml
  17. 1 4
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/25_external_version.yml
  18. 1 6
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/26_external_gte_version.yml
  19. 1 4
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/30_routing.yml
  20. 3 18
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/50_refresh.yml
  21. 2 4
      rest-api-spec/src/main/resources/rest-api-spec/test/delete/60_missing.yml
  22. 2 12
      rest-api-spec/src/main/resources/rest-api-spec/test/get/10_basic.yml
  23. 2 5
      rest-api-spec/src/main/resources/rest-api-spec/test/get/15_default_values.yml
  24. 2 7
      rest-api-spec/src/main/resources/rest-api-spec/test/get/20_stored_fields.yml
  25. 1 4
      rest-api-spec/src/main/resources/rest-api-spec/test/get/40_routing.yml
  26. 2 5
      rest-api-spec/src/main/resources/rest-api-spec/test/get/50_with_headers.yml
  27. 1 5
      rest-api-spec/src/main/resources/rest-api-spec/test/get/60_realtime_refresh.yml
  28. 9 12
      rest-api-spec/src/main/resources/rest-api-spec/test/get/70_source_filtering.yml
  29. 2 6
      rest-api-spec/src/main/resources/rest-api-spec/test/get/80_missing.yml
  30. 1 11
      rest-api-spec/src/main/resources/rest-api-spec/test/get/90_versions.yml
  31. 3 15
      rest-api-spec/src/main/resources/rest-api-spec/test/index/10_with_id.yml
  32. 1 4
      rest-api-spec/src/main/resources/rest-api-spec/test/index/12_result.yml
  33. 3 13
      rest-api-spec/src/main/resources/rest-api-spec/test/index/15_without_id.yml
  34. 1 4
      rest-api-spec/src/main/resources/rest-api-spec/test/index/20_optype.yml
  35. 1 5
      rest-api-spec/src/main/resources/rest-api-spec/test/index/30_internal_version.yml
  36. 1 6
      rest-api-spec/src/main/resources/rest-api-spec/test/index/35_external_version.yml
  37. 1 6
      rest-api-spec/src/main/resources/rest-api-spec/test/index/36_external_gte_version.yml
  38. 1 5
      rest-api-spec/src/main/resources/rest-api-spec/test/index/40_routing.yml
  39. 3 11
      rest-api-spec/src/main/resources/rest-api-spec/test/index/60_refresh.yml
  40. 5 10
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/10_basic.yml
  41. 1 2
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml
  42. 3 7
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml
  43. 1 2
      rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml
  44. 0 46
      rest-api-spec/src/main/resources/rest-api-spec/test/search/220_no_types.yml
  45. 2 15
      rest-api-spec/src/main/resources/rest-api-spec/test/update/10_doc.yml
  46. 2 4
      rest-api-spec/src/main/resources/rest-api-spec/test/update/11_shard_header.yml
  47. 1 6
      rest-api-spec/src/main/resources/rest-api-spec/test/update/12_result.yml
  48. 1 6
      rest-api-spec/src/main/resources/rest-api-spec/test/update/20_doc_upsert.yml
  49. 1 6
      rest-api-spec/src/main/resources/rest-api-spec/test/update/22_doc_as_upsert.yml
  50. 1 4
      rest-api-spec/src/main/resources/rest-api-spec/test/update/30_internal_version.yml
  51. 1 3
      rest-api-spec/src/main/resources/rest-api-spec/test/update/35_other_versions.yml
  52. 1 5
      rest-api-spec/src/main/resources/rest-api-spec/test/update/40_routing.yml
  53. 3 14
      rest-api-spec/src/main/resources/rest-api-spec/test/update/60_refresh.yml
  54. 1 3
      rest-api-spec/src/main/resources/rest-api-spec/test/update/80_source_filtering.yml
  55. 0 2
      rest-api-spec/src/main/resources/rest-api-spec/test/update/85_fields_meta.yml
  56. 1 3
      server/src/main/java/org/elasticsearch/action/DocWriteResponse.java
  57. 1 3
      server/src/main/java/org/elasticsearch/index/get/GetResult.java
  58. 0 5
      server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java
  59. 3 8
      server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java
  60. 3 8
      server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java
  61. 3 8
      server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java
  62. 0 5
      server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
  63. 1 1
      server/src/main/java/org/elasticsearch/search/SearchHit.java

+ 6 - 5
docs/reference/mapping/removal_of_types.asciidoc

@@ -495,12 +495,12 @@ The above call returns
 [float]
 ==== Document APIs
 
-Index APIs must be call with the `{index}/_doc` path for automatic generation of
+Index APIs must be called with the `{index}/_doc` path for automatic generation of
 the `_id` and `{index}/_doc/{id}` with explicit ids.
 
 [source,js]
 --------------------------------------------------
-PUT index/_doc/1?include_type_name=false
+PUT index/_doc/1
 {
   "foo": "bar"
 }
@@ -512,6 +512,7 @@ PUT index/_doc/1?include_type_name=false
 {
   "_index": "index", <1>
   "_id": "1",
+  "_type": "_doc",
   "_version": 1,
   "result": "created",
   "_shards": {
@@ -526,6 +527,6 @@ PUT index/_doc/1?include_type_name=false
 // TESTRESPONSE
 <1> The response does not include a `_type`.
 
-Likewise the <<docs-index_,GET>>, <<docs-delete,`DELETE`>>,
-<<docs-update,`_update`>> and <<search,`_search`>> APIs do not return a `_type`
-key in the response when `include_type_name` is set to `false`.
+The <<docs-index_,GET>>, <<docs-delete,`DELETE`>>, <<docs-update,`_update`>> and <<search,`_search`>> APIs
+will continue to return a `_type` key in the response in 7.0, but it is considered deprecated and will be
+removed in 8.0.

+ 0 - 4
rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json

@@ -16,10 +16,6 @@
         }
       },
       "params": {
-        "include_type_name": {
-          "type" : "string",
-          "description" : "Whether to add the type name to the response"
-        },
         "wait_for_active_shards": {
           "type" : "string",
           "description" : "Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)" 

+ 0 - 4
rest-api-spec/src/main/resources/rest-api-spec/api/delete.json

@@ -22,10 +22,6 @@
         }
       },
       "params": {
-        "include_type_name": {
-          "type" : "string",
-          "description" : "Whether to add the type name to the response"
-        },
         "wait_for_active_shards": {
           "type" : "string",
           "description" : "Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"

+ 0 - 4
rest-api-spec/src/main/resources/rest-api-spec/api/get.json

@@ -22,10 +22,6 @@
         }
       },
       "params": {
-        "include_type_name": {
-          "type" : "string",
-          "description" : "Whether to add the type name to the response"
-        },
         "stored_fields": {
           "type": "list",
           "description" : "A comma-separated list of stored fields to return in the response"

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

@@ -21,10 +21,6 @@
         }
       },
       "params": {
-        "include_type_name": {
-          "type" : "string",
-          "description" : "Whether to add the type name to the response"
-        },
         "wait_for_active_shards": {
           "type" : "string",
           "description" : "Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"

+ 0 - 4
rest-api-spec/src/main/resources/rest-api-spec/api/search.json

@@ -16,10 +16,6 @@
         }
       },
       "params": {
-        "include_type_name": {
-          "type" : "string",
-          "description" : "Whether to add the type name to the response"
-        },
         "analyzer": {
           "type" : "string",
           "description" : "The analyzer to use for the query string"

+ 0 - 4
rest-api-spec/src/main/resources/rest-api-spec/api/update.json

@@ -22,10 +22,6 @@
         }
       },
       "params": {
-        "include_type_name": {
-          "type" : "string",
-          "description" : "Whether to add the type name to the response"
-        },
         "wait_for_active_shards": {
           "type": "string",
           "description": "Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)"

+ 3 - 6
rest-api-spec/src/main/resources/rest-api-spec/test/bulk/10_basic.yml

@@ -3,11 +3,10 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
   - do:
       bulk:
-        include_type_name: false
         refresh: true
         body:
           - index:
@@ -32,11 +31,10 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
   - do:
       bulk:
-        include_type_name: false
         refresh: true
         body:
           - index:
@@ -69,14 +67,13 @@
   - skip:
       version: " - 6.99.99"
       features: headers
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
   - do:
       catch: /Malformed action\/metadata line \[3\], expected FIELD_NAME but found \[END_OBJECT\]/
       headers:
         Content-Type: application/json
       bulk:
-        include_type_name: false
         body: |
            {"index": {"_index": "test_index", "_id": "test_id"}}
            {"f1": "v1", "f2": 42}

+ 1 - 3
rest-api-spec/src/main/resources/rest-api-spec/test/bulk/20_list_of_strings.yml

@@ -3,11 +3,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       bulk:
-        include_type_name: false
         refresh: true
         body:
           - '{"index": {"_index": "test_index", "_id": "test_id"}}'

+ 1 - 3
rest-api-spec/src/main/resources/rest-api-spec/test/bulk/30_big_string.yml

@@ -3,11 +3,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       bulk:
-        include_type_name: false
         refresh: true
         body: |
           {"index": {"_index": "test_index", "_id": "test_id"}}

+ 1 - 9
rest-api-spec/src/main/resources/rest-api-spec/test/bulk/40_source.yml

@@ -3,11 +3,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       index:
-        include_type_name: false
         refresh: true
         index: test_index
         id: test_id_1
@@ -15,7 +13,6 @@
 
   - do:
       index:
-        include_type_name: false
         refresh: true
         index: test_index
         id: test_id_2
@@ -23,7 +20,6 @@
 
   - do:
       index:
-        include_type_name: false
         refresh: true
         index: test_index
         id: test_id_3
@@ -32,7 +28,6 @@
 
   - do:
       bulk:
-        include_type_name: false
         refresh: true
         body: |
           { "update": { "_index": "test_index", "_id": "test_id_1", "_source": true } }
@@ -45,7 +40,6 @@
 
   - do:
       bulk:
-        include_type_name: false
         index: test_index
         _source: true
         body: |
@@ -56,7 +50,6 @@
 
   - do:
       bulk:
-        include_type_name: false
         refresh: true
         body: |
           { "update": { "_index": "test_index", "_id": "test_id_1", "_source": {"includes": "bar"} } }
@@ -71,7 +64,6 @@
 
   - do:
       bulk:
-        include_type_name: false
         index: test_index
         _source_includes: foo
         body: |

+ 3 - 9
rest-api-spec/src/main/resources/rest-api-spec/test/bulk/50_refresh.yml

@@ -3,11 +3,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       bulk:
-        include_type_name: false
         refresh: true
         body: |
           {"index": {"_index": "bulk_50_refresh_1", "_id": "bulk_50_refresh_id1"}}
@@ -25,11 +23,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       bulk:
-        include_type_name: false
         refresh: ""
         body: |
           {"index": {"_index": "bulk_50_refresh_2", "_id": "bulk_50_refresh_id3"}}
@@ -48,11 +44,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       bulk:
-        include_type_name: false
         refresh: wait_for
         body: |
           {"index": {"_index": "bulk_50_refresh_3", "_id": "bulk_50_refresh_id5"}}

+ 1 - 11
rest-api-spec/src/main/resources/rest-api-spec/test/delete/10_basic.yml

@@ -3,11 +3,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:  test_1
           id:     1
           body:   { foo: bar }
@@ -16,16 +15,7 @@
 
  - do:
       delete:
-          include_type_name: false
           index:  test_1
           id:     1
 
  - match:   { _version: 2 }
-
- - do:
-      catch: /illegal_argument_exception/
-      delete:
-          include_type_name: false
-          index:   index
-          type:    type
-          id:      1

+ 2 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/delete/11_shard_header.yml

@@ -3,7 +3,7 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       indices.create:
@@ -20,19 +20,17 @@
 
  - do:
       index:
-          include_type_name: false
           index:  foobar
           id:     1
           body:   { foo: bar }
 
  - do:
        delete:
-           include_type_name: false
            index:  foobar
            id:     1
 
  - match:   { _index:   foobar }
- - is_false: "_type"
+ - match:   { _type: _doc }
  - match:   { _id:      "1"}
  - match:   { _version: 2}
  - match:   { _shards.total: 1}

+ 1 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/delete/12_result.yml

@@ -3,18 +3,16 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           body:    { foo: bar }
 
  - do:
       delete:
-          include_type_name: false
           index:   test_1
           id:      1
 
@@ -23,7 +21,6 @@
  - do:
       catch: missing
       delete:
-          include_type_name: false
           index:   test_1
           id:      1
 

+ 1 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/delete/20_internal_version.yml

@@ -3,11 +3,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           body:    { foo: bar }
@@ -17,14 +16,12 @@
  - do:
       catch:       conflict
       delete:
-          include_type_name: false
           index:   test_1
           id:      1
           version: 2
 
  - do:
       delete:
-          include_type_name: false
           index:   test_1
           id:      1
           version: 1

+ 1 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/delete/25_external_version.yml

@@ -3,11 +3,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }
@@ -19,7 +18,6 @@
  - do:
       catch:             conflict
       delete:
-          include_type_name: false
           index:          test_1
           id:             1
           version_type:   external
@@ -27,7 +25,6 @@
 
  - do:
       delete:
-          include_type_name: false
           index:          test_1
           id:             1
           version_type:   external

+ 1 - 6
rest-api-spec/src/main/resources/rest-api-spec/test/delete/26_external_gte_version.yml

@@ -3,11 +3,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }
@@ -19,7 +18,6 @@
  - do:
       catch:             conflict
       delete:
-          include_type_name: false
           index:          test_1
           id:             1
           version_type:   external_gte
@@ -27,7 +25,6 @@
 
  - do:
       delete:
-          include_type_name: false
           index:          test_1
           id:             1
           version_type:   external_gte
@@ -37,7 +34,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }
@@ -48,7 +44,6 @@
 
  - do:
       delete:
-          include_type_name: false
           index:          test_1
           id:             1
           version_type:   external_gte

+ 1 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/delete/30_routing.yml

@@ -3,7 +3,7 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       indices.create:
@@ -14,7 +14,6 @@
               number_of_shards: 5
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           routing: 5
@@ -23,14 +22,12 @@
  - do:
       catch:      missing
       delete:
-          include_type_name: false
           index:   test_1
           id:      1
           routing: 4
 
  - do:
       delete:
-          include_type_name: false
           index:   test_1
           id:      1
           routing: 5

+ 3 - 18
rest-api-spec/src/main/resources/rest-api-spec/test/delete/50_refresh.yml

@@ -3,7 +3,7 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       indices.create:
@@ -21,7 +21,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           body:    { foo: bar }
@@ -32,7 +31,6 @@
 # them to be different for this test to pass
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      3
           body:    { foo: bar }
@@ -41,7 +39,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { terms: { _id: [1,3] }}
@@ -50,13 +47,11 @@
 
  - do:
       delete:
-          include_type_name: false
           index:   test_1
           id:      1
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { terms: { _id: [1,3] }}
@@ -65,7 +60,6 @@
 
  - do:
       delete:
-          include_type_name: false
           index:   test_1
           id:      3
           refresh: true
@@ -76,7 +70,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { terms: { _id: [1,3] }}
@@ -88,11 +81,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           body:    { foo: bar }
@@ -101,7 +93,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { term: { _id: 1 }}
@@ -109,14 +100,12 @@
 
  - do:
       delete:
-          include_type_name: false
           index:   test_1
           id:      1
           refresh: ""
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { term: { _id: 1 }}
@@ -127,11 +116,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:   delete_50_refresh_1
           id:      delete_50_refresh_id1
           body:    { foo: bar }
@@ -140,7 +128,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   delete_50_refresh_1
           body:
             query:   { term: { _id: delete_50_refresh_id1 }}
@@ -148,7 +135,6 @@
 
  - do:
      delete:
-         include_type_name: false
          index:   delete_50_refresh_1
          id:      delete_50_refresh_id1
          refresh: wait_for
@@ -156,7 +142,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   delete_50_refresh_1
           body:
             query:   { term: { _id: delete_50_refresh_id1 }}

+ 2 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/delete/60_missing.yml

@@ -3,12 +3,11 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       catch:      missing
       delete:
-          include_type_name: false
           index:  test_1
           id:     1
 
@@ -17,11 +16,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       delete:
-          include_type_name: false
           index:  test_1
           id:     1
           ignore: 404

+ 2 - 12
rest-api-spec/src/main/resources/rest-api-spec/test/get/10_basic.yml

@@ -3,30 +3,20 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
   - do:
       index:
-        include_type_name: false
         index: test_1
         id:    中文
         body:  { "foo": "Hello: 中文" }
 
   - do:
       get:
-        include_type_name: false
         index: test_1
         id:    中文
 
   - match: { _index:   test_1 }
-  - is_false: "_type"
+  - match: { _type: _doc }
   - match: { _id:      中文      }
   - match: { _source:  { foo: "Hello: 中文" } }
-
-  - do:
-      catch: /illegal_argument_exception/
-      get:
-          index:   index
-          type:    type
-          id:      1
-          include_type_name: false

+ 2 - 5
rest-api-spec/src/main/resources/rest-api-spec/test/get/15_default_values.yml

@@ -3,23 +3,20 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       index:
-        include_type_name: false
         index: test_1
         id:    1
         body:  { "foo": "bar" }
 
   - do:
       get:
-        include_type_name: false
         index: test_1
         id:    1
 
   - match: { _index:   test_1 }
-  - is_false: "_type"
+  - match: { _type: _doc }
   - match: { _id:      '1'    }
   - match: { _source:  { foo: "bar" } }
 

+ 2 - 7
rest-api-spec/src/main/resources/rest-api-spec/test/get/20_stored_fields.yml

@@ -3,8 +3,7 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         include_type_name: false
@@ -21,26 +20,23 @@
 
   - do:
       index:
-        include_type_name: false
         index:  test_1
         id:     1
         body:   { "foo": "bar", "count": 1 }
   - do:
       get:
-        include_type_name: false
         index:  test_1
         id:     1
         stored_fields: foo
 
   - match:   { _index:   test_1  }
-  - is_false: "_type"
+  - match:   { _type: _doc }
   - match:   { _id:      '1'     }
   - match:   { fields.foo:  [bar] }
   - is_false:  _source
 
   - do:
       get:
-        include_type_name: false
         index:  test_1
         id:     1
         stored_fields: [foo, count]
@@ -51,7 +47,6 @@
 
   - do:
       get:
-        include_type_name: false
         index:  test_1
         id:     1
         stored_fields: [foo, count, _source]

+ 1 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/get/40_routing.yml

@@ -3,7 +3,7 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
      indices.create:
@@ -22,7 +22,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           routing: 5
@@ -30,7 +29,6 @@
 
  - do:
       get:
-          include_type_name: false
           index:   test_1
           id:      1
           routing: 5
@@ -42,7 +40,6 @@
  - do:
       catch: missing
       get:
-          include_type_name: false
           index:   test_1
           id:      1
 

+ 2 - 5
rest-api-spec/src/main/resources/rest-api-spec/test/get/50_with_headers.yml

@@ -3,11 +3,9 @@
   - skip:
       features: ["headers", "yaml"]
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       index:
-        include_type_name: false
         index: test_1
         id:    1
         body:  { "body": "foo" }
@@ -16,12 +14,11 @@
       headers:
         Accept: application/yaml
       get:
-        include_type_name: false
         index: test_1
         id:   1
 
   - match: {_index: "test_1"}
-  - is_false: "_type"
+  - match: { _type: _doc }
   - match: {_id: "1"}
   - match: {_version: 1}
   - match: {found: true}

+ 1 - 5
rest-api-spec/src/main/resources/rest-api-spec/test/get/60_realtime_refresh.yml

@@ -3,7 +3,7 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       indices.create:
@@ -21,7 +21,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           body:    { foo: bar }
@@ -29,14 +28,12 @@
  - do:
       catch:        missing
       get:
-          include_type_name: false
           index:    test_1
           id:       1
           realtime: false
 
  - do:
       get:
-          include_type_name: false
           index:    test_1
           id:       1
           realtime: true
@@ -45,7 +42,6 @@
 
  - do:
       get:
-          include_type_name: false
           index:    test_1
           id:       1
           realtime: false

+ 9 - 12
rest-api-spec/src/main/resources/rest-api-spec/test/get/70_source_filtering.yml

@@ -3,8 +3,7 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         include_type_name: false
@@ -18,40 +17,39 @@
 
   - do:
       index:
-        include_type_name: false
         index:  test_1
         id:     1
         body:   { "include": { "field1": "v1", "field2": "v2" }, "count": 1 }
   - do:
-      get: { include_type_name: false, index:  test_1, id: 1, _source: false }
+      get: { index:  test_1, id: 1, _source: false }
 
   - match:   { _index:   test_1  }
-  - is_false: "_type"
+  - match:   { _type: _doc }
   - match:   { _id:      "1"       }
   - is_false:  _source
 
   - do:
-      get: { include_type_name: false, index:  test_1, id: 1, _source: true }
+      get: { index:  test_1, id: 1, _source: true }
   - match:  { _source.include.field1: v1 }
 
   - do:
-      get: { include_type_name: false, index:  test_1, id: 1, _source: include.field1 }
+      get: { index:  test_1, id: 1, _source: include.field1 }
   - match:  { _source.include.field1: v1 }
   - is_false: _source.include.field2
 
   - do:
-      get: { include_type_name: false, index:  test_1, id: 1, _source_includes: include.field1 }
+      get: { index:  test_1, id: 1, _source_includes: include.field1 }
   - match:  { _source.include.field1: v1 }
   - is_false: _source.include.field2
 
   - do:
-      get: { include_type_name: false, index:  test_1, id: 1, _source_includes: "include.field1,include.field2" }
+      get: { index:  test_1, id: 1, _source_includes: "include.field1,include.field2" }
   - match:  { _source.include.field1: v1 }
   - match:  { _source.include.field2: v2 }
   - is_false: _source.count
 
   - do:
-      get: { include_type_name: false, index:  test_1, id: 1, _source_includes: include, _source_excludes: "*.field2" }
+      get: { index:  test_1, id: 1, _source_includes: include, _source_excludes: "*.field2" }
   - match:  { _source.include.field1: v1 }
   - is_false: _source.include.field2
   - is_false: _source.count
@@ -59,14 +57,13 @@
 
   - do:
       get:
-        include_type_name: false
         index:  test_1
         id:     1
         stored_fields: count
         _source: true
 
   - match:   { _index:   test_1  }
-  - is_false: "_type"
+  - match:   { _type: _doc }
   - match:   { _id:      "1"       }
   - match:   { fields.count:  [1] }
   - match:   { _source.include.field1: v1 }

+ 2 - 6
rest-api-spec/src/main/resources/rest-api-spec/test/get/80_missing.yml

@@ -3,12 +3,10 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       catch:   missing
       get:
-        include_type_name: false
         index: test_1
         id:    1
 
@@ -17,11 +15,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       get:
-        include_type_name: false
         index:  test_1
         id:     1
         ignore: 404

+ 1 - 11
rest-api-spec/src/main/resources/rest-api-spec/test/get/90_versions.yml

@@ -3,11 +3,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:  test_1
           id:     1
           body:   { foo: bar }
@@ -15,7 +14,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:  test_1
           id:     1
           body:   { foo: bar }
@@ -23,7 +21,6 @@
 
  - do:
       get:
-          include_type_name: false
           index:  test_1
           id:     1
           version: 2
@@ -32,14 +29,12 @@
  - do:
       catch:      conflict
       get:
-          include_type_name: false
           index:  test_1
           id:     1
           version: 1
 
  - do:
       get:
-          include_type_name: false
           index:  test_1
           id:     1
           version: 2
@@ -49,7 +44,6 @@
  - do:
       catch:      conflict
       get:
-          include_type_name: false
           index:  test_1
           id:     1
           version: 10
@@ -58,7 +52,6 @@
  - do:
       catch:      conflict
       get:
-          include_type_name: false
           index:  test_1
           id:     1
           version: 1
@@ -66,7 +59,6 @@
 
  - do:
       get:
-          include_type_name: false
           index:  test_1
           id:     1
           version: 2
@@ -76,7 +68,6 @@
  - do:
       catch:      conflict
       get:
-          include_type_name: false
           index:  test_1
           id:     1
           version: 10
@@ -85,7 +76,6 @@
  - do:
       catch:      conflict
       get:
-          include_type_name: false
           index:  test_1
           id:     1
           version: 1

+ 3 - 15
rest-api-spec/src/main/resources/rest-api-spec/test/index/10_with_id.yml

@@ -3,28 +3,26 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:  test-weird-index-中文
           id:     1
           body:   { foo: bar }
 
  - match:   { _index:   test-weird-index-中文 }
- - is_false: "_type"
+ - match:   { _type: _doc }
  - match:   { _id:      "1"}
  - match:   { _version: 1}
 
  - do:
       get:
-          include_type_name: false
           index:  test-weird-index-中文
           id:     1
 
  - match:   { _index:   test-weird-index-中文 }
- - is_false: "_type"
+ - match:   { _type: _doc }
  - match:   { _id:      "1"}
  - match:   { _version: 1}
  - match:   { _source: { foo: bar }}
@@ -32,16 +30,6 @@
  - do:
       catch: bad_request
       index:
-          include_type_name: false
           index:  idx
           id:     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
           body:   { foo: bar }
-
- - do:
-      catch: /illegal_argument_exception/
-      index:
-          index:   index
-          type:    type
-          id:      1
-          include_type_name: false
-          body:    { foo: bar }

+ 1 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/index/12_result.yml

@@ -3,11 +3,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       index:
-          include_type_name: false
           index:  test_index
           id:     1
           body:   { foo: bar }
@@ -16,7 +14,6 @@
 
   - do:
       index:
-          include_type_name: false
           index:    test_index
           id:       1
           body:     { foo: bar }

+ 3 - 13
rest-api-spec/src/main/resources/rest-api-spec/test/index/15_without_id.yml

@@ -3,36 +3,26 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:  test_1
           body:   { foo: bar }
 
  - is_true:   _id
  - match:   { _index:   test_1 }
- - is_false: "_type"
+ - match:   { _type: _doc }
  - match:   { _version: 1      }
  - set:     { _id:      id    }
 
  - do:
       get:
-          include_type_name: false
           index:  test_1
           id:     '$id'
 
  - match:   { _index:   test_1 }
- - is_false: "_type"
+ - match:   { _type: _doc }
  - match:   { _id:      $id    }
  - match:   { _version: 1      }
  - match:   { _source: { foo: bar }}
-
- - do:
-      catch: /illegal_argument_exception/
-      index:
-          index:   index
-          type:    type
-          include_type_name: false
-          body:    { foo: bar }

+ 1 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/index/20_optype.yml

@@ -3,11 +3,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:    test_1
           id:       1
           op_type:  create
@@ -16,7 +15,6 @@
  - do:
       catch:      conflict
       index:
-          include_type_name: false
           index:    test_1
           id:       1
           op_type:  create
@@ -24,7 +22,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:    test_1
           id:       1
           op_type:  index

+ 1 - 5
rest-api-spec/src/main/resources/rest-api-spec/test/index/30_internal_version.yml

@@ -3,11 +3,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:  test_1
           id:     1
           body:   { foo: bar }
@@ -15,7 +14,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:  test_1
           id:     1
           body:   { foo: bar }
@@ -24,14 +22,12 @@
  - do:
       catch:       conflict
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           body:    { foo: bar }
           version: 1
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           body:    { foo: bar }

+ 1 - 6
rest-api-spec/src/main/resources/rest-api-spec/test/index/35_external_version.yml

@@ -3,11 +3,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }
@@ -18,7 +17,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }
@@ -30,7 +28,6 @@
  - do:
       catch:             conflict
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }
@@ -40,7 +37,6 @@
  - do:
       catch:             conflict
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }
@@ -49,7 +45,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }

+ 1 - 6
rest-api-spec/src/main/resources/rest-api-spec/test/index/36_external_gte_version.yml

@@ -3,11 +3,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }
@@ -18,7 +17,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }
@@ -30,7 +28,6 @@
  - do:
       catch:             conflict
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar }
@@ -39,7 +36,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar2 }
@@ -50,7 +46,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:          test_1
           id:             1
           body:           { foo: bar2 }

+ 1 - 5
rest-api-spec/src/main/resources/rest-api-spec/test/index/40_routing.yml

@@ -3,8 +3,7 @@
 
  - skip:
      version: " - 6.99.99"
-     reason:  include_type_name was introduced in 7.0.0
-
+     reason: types are required in requests before 7.0.0
  - do:
      indices.create:
        include_type_name: false
@@ -22,7 +21,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           routing: 5
@@ -30,7 +28,6 @@
 
  - do:
       get:
-          include_type_name: false
           index:   test_1
           id:      1
           routing: 5
@@ -42,7 +39,6 @@
  - do:
       catch: missing
       get:
-          include_type_name: false
           index:   test_1
           id:      1
 

+ 3 - 11
rest-api-spec/src/main/resources/rest-api-spec/test/index/60_refresh.yml

@@ -3,7 +3,7 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       indices.create:
@@ -16,14 +16,12 @@
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           body:    { foo: bar }
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { term: { _id: 1 }}
@@ -32,7 +30,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      2
           refresh: true
@@ -41,7 +38,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { term: { _id: 2 }}
@@ -53,11 +49,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           refresh: ""
@@ -66,7 +61,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { term: { _id: 1 }}
@@ -78,11 +72,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:   index_60_refresh_1
           id:      index_60_refresh_id1
           body:    { foo: bar }
@@ -91,7 +84,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   index_60_refresh_1
           body:
             query:   { term: { _id: index_60_refresh_id1 }}

+ 5 - 10
rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/10_basic.yml

@@ -3,8 +3,7 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         include_type_name: false
@@ -25,8 +24,7 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         include_type_name: false
@@ -46,8 +44,7 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         include_type_name: false
@@ -61,8 +58,7 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         include_type_name: false
@@ -80,8 +76,7 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         include_type_name: false

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

@@ -2,8 +2,7 @@
 setup:
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
         indices.create:
           include_type_name: false

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

@@ -3,8 +3,7 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         include_type_name: false
@@ -63,8 +62,7 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         include_type_name: false
@@ -84,8 +82,7 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         index: index
@@ -101,4 +98,3 @@
           properties:
             bar:
               type: float
-

+ 1 - 2
rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml

@@ -1,8 +1,7 @@
 setup:
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       indices.create:
         include_type_name: false

+ 0 - 46
rest-api-spec/src/main/resources/rest-api-spec/test/search/220_no_types.yml

@@ -1,46 +0,0 @@
----
-"No type returned":
-
-  - skip:
-      version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
-  - do:
-      index:
-        include_type_name: false
-        index:  test_1
-        id:     1
-        body:   {}
-  - do:
-      indices.refresh: {}
-
-  - do:
-      search:
-        include_type_name: false
-        index: test_1
-
-  - length:   { hits.hits: 1  }
-  - match: { hits.hits.0._index: "test_1" }
-  - is_false: "hits.hits.0._type"
-  - match: { hits.hits.0._id: "1" }
-
----
-"Mixing include_type_name=false with explicit types":
-
-  - skip:
-      version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
-  - do:
-      catch: /illegal_argument_exception/
-      search:
-          index:   index
-          type:    type
-          include_type_name: false
-
-  - do:
-      catch: /illegal_argument_exception/
-      search:
-          index:   index
-          type:    _doc
-          include_type_name: false

+ 2 - 15
rest-api-spec/src/main/resources/rest-api-spec/test/update/10_doc.yml

@@ -3,11 +3,10 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
   - do:
       index:
-          include_type_name: false
           index:  test_1
           id:     1
           body:
@@ -17,7 +16,6 @@
 
   - do:
       update:
-          include_type_name: false
           index:  test_1
           id:     1
           body:
@@ -27,13 +25,12 @@
                     one:  3
 
   - match: { _index:   test_1 }
-  - is_false:  "_type"
+  - match: { _type: _doc }
   - match: { _id:      "1"    }
   - match: { _version: 2      }
 
   - do:
       get:
-          include_type_name: false
           index:  test_1
           id:     1
 
@@ -41,13 +38,3 @@
   - match: { _source.count:      1   }
   - match: { _source.nested.one: 3   }
   - match: { _source.nested.two: 2   }
-
-  - do:
-      catch: /illegal_argument_exception/
-      update:
-          index:   index
-          type:    type
-          id:      1
-          include_type_name: false
-          body:
-              doc:    { foo: baz }

+ 2 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/update/11_shard_header.yml

@@ -3,7 +3,7 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       indices.create:
@@ -20,14 +20,12 @@
 
  - do:
       index:
-          include_type_name: false
           index:  foobar
           id:     1
           body:   { foo: bar }
 
  - do:
       update:
-           include_type_name: false
            index:  foobar
            id:     1
            body:
@@ -35,7 +33,7 @@
                    foo: baz
 
  - match:   { _index:   foobar }
- - is_false: "_type"
+ - match:   { _type: _doc }
  - match:   { _id:      "1"}
  - match:   { _version: 2}
  - match:   { _shards.total: 1}

+ 1 - 6
rest-api-spec/src/main/resources/rest-api-spec/test/update/12_result.yml

@@ -3,11 +3,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       update:
-          include_type_name: false
           index:            test_1
           id:               1
           body:
@@ -19,7 +17,6 @@
 
   - do:
       update:
-          include_type_name: false
           index:            test_1
           id:               1
           body:
@@ -31,7 +28,6 @@
 
   - do:
       update:
-          include_type_name: false
           index:            test_1
           id:               1
           body:
@@ -44,7 +40,6 @@
 
   - do:
       update:
-          include_type_name: false
           index:            test_1
           id:               1
           body:

+ 1 - 6
rest-api-spec/src/main/resources/rest-api-spec/test/update/20_doc_upsert.yml

@@ -3,11 +3,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       update:
-          include_type_name: false
           index:    test_1
           id:       1
           body:
@@ -16,7 +14,6 @@
 
   - do:
       get:
-          include_type_name: false
           index:  test_1
           id:     1
 
@@ -26,7 +23,6 @@
 
   - do:
       update:
-          include_type_name: false
           index:    test_1
           id:       1
           body:
@@ -35,7 +31,6 @@
 
   - do:
       get:
-          include_type_name: false
           index:  test_1
           id:     1
 

+ 1 - 6
rest-api-spec/src/main/resources/rest-api-spec/test/update/22_doc_as_upsert.yml

@@ -3,11 +3,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       update:
-          include_type_name: false
           index:            test_1
           id:               1
           body:
@@ -16,7 +14,6 @@
 
   - do:
       get:
-          include_type_name: false
           index:  test_1
           id:     1
 
@@ -26,7 +23,6 @@
 
   - do:
       update:
-          include_type_name: false
           index:            test_1
           id:               1
           body:
@@ -35,7 +31,6 @@
 
   - do:
       get:
-          include_type_name: false
           index:  test_1
           id:     1
 

+ 1 - 4
rest-api-spec/src/main/resources/rest-api-spec/test/update/30_internal_version.yml

@@ -3,12 +3,11 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       catch:        missing
       update:
-          include_type_name: false
           index:    test_1
           id:       1
           version:  1
@@ -17,7 +16,6 @@
 
  - do:
       index:
-          include_type_name: false
           index:    test_1
           id:       1
           body:
@@ -26,7 +24,6 @@
  - do:
       catch:        conflict
       update:
-          include_type_name: false
           index:    test_1
           id:       1
           version:  2

+ 1 - 3
rest-api-spec/src/main/resources/rest-api-spec/test/update/35_other_versions.yml

@@ -3,12 +3,11 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       catch:            /Validation|Invalid/
       update:
-          include_type_name: false
           index:        test_1
           id:           1
           version:      2
@@ -20,7 +19,6 @@
  - do:
       catch:            /Validation|Invalid/
       update:
-          include_type_name: false
           index:        test_1
           id:           1
           version:      2

+ 1 - 5
rest-api-spec/src/main/resources/rest-api-spec/test/update/40_routing.yml

@@ -3,7 +3,7 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
      indices.create:
@@ -22,7 +22,6 @@
 
  - do:
       update:
-          include_type_name: false
           index:   test_1
           id:      1
           routing: 5
@@ -32,7 +31,6 @@
 
  - do:
       get:
-          include_type_name: false
           index:   test_1
           id:      1
           routing: 5
@@ -43,7 +41,6 @@
  - do:
       catch:      missing
       update:
-          include_type_name: false
           index:   test_1
           id:      1
           body:
@@ -51,7 +48,6 @@
 
  - do:
       update:
-          include_type_name: false
           index:   test_1
           id:      1
           routing: 5

+ 3 - 14
rest-api-spec/src/main/resources/rest-api-spec/test/update/60_refresh.yml

@@ -3,7 +3,7 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       indices.create:
@@ -16,7 +16,6 @@
 
  - do:
       update:
-          include_type_name: false
           index:   test_1
           id:      1
           body:
@@ -25,7 +24,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { term: { _id: 1 }}
@@ -34,7 +32,6 @@
 
  - do:
       update:
-          include_type_name: false
           index:   test_1
           id:      2
           refresh: true
@@ -45,7 +42,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { term: { _id: 2 }}
@@ -57,11 +53,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:   test_1
           id:      1
           refresh: true
@@ -70,7 +65,6 @@
 
  - do:
      update:
-         include_type_name: false
          index:   test_1
          id:      1
          refresh: ""
@@ -80,7 +74,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   test_1
           body:
             query:   { term: { cat: dog }}
@@ -92,11 +85,10 @@
 
  - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
+      reason: types are required in requests before 7.0.0
 
  - do:
       index:
-          include_type_name: false
           index:   update_60_refresh_1
           id:      update_60_refresh_id1
           body:    { foo: bar }
@@ -105,7 +97,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   update_60_refresh_1
           body:
             query:   { term: { _id: update_60_refresh_id1 }}
@@ -113,7 +104,6 @@
 
  - do:
      update:
-         include_type_name: false
          index:   update_60_refresh_1
          id:      update_60_refresh_id1
          refresh: wait_for
@@ -123,7 +113,6 @@
 
  - do:
       search:
-          include_type_name: false
           index:   update_60_refresh_1
           body:
             query:   { match: { test: asdf } }

+ 1 - 3
rest-api-spec/src/main/resources/rest-api-spec/test/update/80_source_filtering.yml

@@ -3,11 +3,9 @@
 
   - skip:
       version: " - 6.99.99"
-      reason:  include_type_name was introduced in 7.0.0
-
+      reason: types are required in requests before 7.0.0
   - do:
       update:
-          include_type_name: false
           index:  test_1
           id:     1
           _source: [foo, bar]

+ 0 - 2
rest-api-spec/src/main/resources/rest-api-spec/test/update/85_fields_meta.yml

@@ -12,7 +12,6 @@
 
   - do:
       update:
-          include_type_name: false
           index:  test_1
           id:     1
           parent: 5
@@ -25,7 +24,6 @@
 
   - do:
       get:
-          include_type_name: false
           index:  test_1
           id:     1
           parent: 5

+ 1 - 3
server/src/main/java/org/elasticsearch/action/DocWriteResponse.java

@@ -296,9 +296,7 @@ public abstract class DocWriteResponse extends ReplicationResponse implements Wr
     public XContentBuilder innerToXContent(XContentBuilder builder, Params params) throws IOException {
         ReplicationResponse.ShardInfo shardInfo = getShardInfo();
         builder.field(_INDEX, shardId.getIndexName());
-        if (params.paramAsBoolean("include_type_name", true)) {
-            builder.field(_TYPE, type);
-        }
+        builder.field(_TYPE, type);
         builder.field(_ID, id)
                 .field(_VERSION, version)
                 .field(RESULT, getResult().getLowercase());

+ 1 - 3
server/src/main/java/org/elasticsearch/index/get/GetResult.java

@@ -256,9 +256,7 @@ public class GetResult implements Streamable, Iterable<DocumentField>, ToXConten
     public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
         builder.startObject();
         builder.field(_INDEX, index);
-        if (params.paramAsBoolean("include_type_name", true)) {
-            builder.field(_TYPE, type);
-        }
+        builder.field(_TYPE, type);
         builder.field(_ID, id);
         if (isExists()) {
             if (version != -1) {

+ 0 - 5
server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java

@@ -73,11 +73,6 @@ public class RestBulkAction extends BaseRestHandler {
         BulkRequest bulkRequest = Requests.bulkRequest();
         String defaultIndex = request.param("index");
         String defaultType = request.param("type");
-        final boolean includeTypeName = request.paramAsBoolean("include_type_name", true);
-        if (includeTypeName == false && defaultType != null) {
-            throw new IllegalArgumentException("You may only use the [include_type_name=false] option with the bulx APIs with the " +
-                    "[_bulk] and [{index}/_bulk] endpoints.");
-        }
         if (defaultType == null) {
             defaultType = MapperService.SINGLE_MAPPING_NAME;
         }

+ 3 - 8
server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java

@@ -24,7 +24,6 @@ import org.elasticsearch.action.support.ActiveShardCount;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.index.VersionType;
-import org.elasticsearch.index.mapper.MapperService;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -48,13 +47,9 @@ public class RestDeleteAction extends BaseRestHandler {
 
     @Override
     public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
-        final boolean includeTypeName = request.paramAsBoolean("include_type_name", true);
-        final String type = request.param("type");
-        if (includeTypeName == false && MapperService.SINGLE_MAPPING_NAME.equals(type) == false) {
-            throw new IllegalArgumentException("You may only use the [include_type_name=false] option with the delete API with the " +
-                    "[{index}/_doc/{id}] endpoints.");
-        }
-        DeleteRequest deleteRequest = new DeleteRequest(request.param("index"), type, request.param("id"));
+        DeleteRequest deleteRequest = new DeleteRequest(request.param("index"),
+            request.param("type"),
+            request.param("id"));
         deleteRequest.routing(request.param("routing"));
         deleteRequest.timeout(request.paramAsTime("timeout", DeleteRequest.DEFAULT_TIMEOUT));
         deleteRequest.setRefreshPolicy(request.param("refresh"));

+ 3 - 8
server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java

@@ -25,7 +25,6 @@ import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.Strings;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.index.VersionType;
-import org.elasticsearch.index.mapper.MapperService;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -56,13 +55,9 @@ public class RestGetAction extends BaseRestHandler {
 
     @Override
     public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
-        final boolean includeTypeName = request.paramAsBoolean("include_type_name", true);
-        final String type = request.param("type");
-        if (includeTypeName == false && MapperService.SINGLE_MAPPING_NAME.equals(type) == false) {
-            throw new IllegalArgumentException("You may only use the [include_type_name=false] option with the get APIs with the " +
-                    "[{index}/_doc/{id}] endpoint.");
-        }
-        final GetRequest getRequest = new GetRequest(request.param("index"), type, request.param("id"));
+        final GetRequest getRequest = new GetRequest(request.param("index"),
+            request.param("type"),
+            request.param("id"));
         getRequest.refresh(request.paramAsBoolean("refresh", getRequest.refresh()));
         getRequest.routing(request.param("routing"));
         getRequest.preference(request.param("preference"));

+ 3 - 8
server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java

@@ -25,7 +25,6 @@ import org.elasticsearch.action.update.UpdateRequest;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.index.VersionType;
-import org.elasticsearch.index.mapper.MapperService;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
 import org.elasticsearch.rest.RestRequest;
@@ -51,13 +50,9 @@ public class RestUpdateAction extends BaseRestHandler {
 
     @Override
     public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
-        final boolean includeTypeName = request.paramAsBoolean("include_type_name", true);
-        final String type = request.param("type");
-        if (includeTypeName == false && MapperService.SINGLE_MAPPING_NAME.equals(type) == false) {
-            throw new IllegalArgumentException("You may only use the [include_type_name=false] option with the update API with the " +
-                    "[{index}/_doc/{id}/_update] endpoint.");
-        }
-        UpdateRequest updateRequest = new UpdateRequest(request.param("index"), type, request.param("id"));
+        UpdateRequest updateRequest = new UpdateRequest(request.param("index"),
+            request.param("type"),
+            request.param("id"));
         updateRequest.routing(request.param("routing"));
         updateRequest.timeout(request.paramAsTime("timeout", updateRequest.timeout()));
         updateRequest.setRefreshPolicy(request.param("refresh"));

+ 0 - 5
server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java

@@ -150,13 +150,8 @@ public class RestSearchAction extends BaseRestHandler {
             searchRequest.scroll(new Scroll(parseTimeValue(scroll, null, "scroll")));
         }
 
-        final boolean includeTypeName = request.paramAsBoolean("include_type_name", true);
         String types = request.param("type");
         if (types != null) {
-            if (includeTypeName == false) {
-                throw new IllegalArgumentException("You may only use the [include_type_name=false] option with the search API with the " +
-                        "[{index}/_search] endpoint.");
-            }
             deprecationLogger.deprecated("The {index}/{type}/_search endpoint is deprecated, use {index}/_search instead");
         }
         searchRequest.types(Strings.splitStringByCommaToArray(types));

+ 1 - 1
server/src/main/java/org/elasticsearch/search/SearchHit.java

@@ -429,7 +429,7 @@ public final class SearchHit implements Streamable, ToXContentObject, Iterable<D
         if (index != null) {
             builder.field(Fields._INDEX, RemoteClusterAware.buildRemoteIndexName(clusterAlias, index));
         }
-        if (type != null && params.paramAsBoolean("include_type_name", true)) {
+        if (type != null) {
             builder.field(Fields._TYPE, type);
         }
         if (id != null) {