From ec53288fc0c94c4f514b24b2230671c7ec0316ed Mon Sep 17 00:00:00 2001 From: Julie Tibshirani Date: Tue, 6 Nov 2018 14:33:48 -0800 Subject: [PATCH] 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. --- .../mapping/removal_of_types.asciidoc | 11 +++-- .../resources/rest-api-spec/api/bulk.json | 4 -- .../resources/rest-api-spec/api/delete.json | 4 -- .../main/resources/rest-api-spec/api/get.json | 4 -- .../resources/rest-api-spec/api/index.json | 4 -- .../resources/rest-api-spec/api/search.json | 4 -- .../resources/rest-api-spec/api/update.json | 4 -- .../rest-api-spec/test/bulk/10_basic.yml | 9 ++-- .../test/bulk/20_list_of_strings.yml | 4 +- .../rest-api-spec/test/bulk/30_big_string.yml | 4 +- .../rest-api-spec/test/bulk/40_source.yml | 10 +--- .../rest-api-spec/test/bulk/50_refresh.yml | 12 ++--- .../rest-api-spec/test/delete/10_basic.yml | 12 +---- .../test/delete/11_shard_header.yml | 6 +-- .../rest-api-spec/test/delete/12_result.yml | 5 +- .../test/delete/20_internal_version.yml | 5 +- .../test/delete/25_external_version.yml | 5 +- .../test/delete/26_external_gte_version.yml | 7 +-- .../rest-api-spec/test/delete/30_routing.yml | 5 +- .../rest-api-spec/test/delete/50_refresh.yml | 21 ++------- .../rest-api-spec/test/delete/60_missing.yml | 6 +-- .../rest-api-spec/test/get/10_basic.yml | 14 +----- .../test/get/15_default_values.yml | 7 +-- .../test/get/20_stored_fields.yml | 9 +--- .../rest-api-spec/test/get/40_routing.yml | 5 +- .../test/get/50_with_headers.yml | 7 +-- .../test/get/60_realtime_refresh.yml | 6 +-- .../test/get/70_source_filtering.yml | 21 ++++----- .../rest-api-spec/test/get/80_missing.yml | 8 +--- .../rest-api-spec/test/get/90_versions.yml | 12 +---- .../rest-api-spec/test/index/10_with_id.yml | 18 ++------ .../rest-api-spec/test/index/12_result.yml | 5 +- .../test/index/15_without_id.yml | 16 ++----- .../rest-api-spec/test/index/20_optype.yml | 5 +- .../test/index/30_internal_version.yml | 6 +-- .../test/index/35_external_version.yml | 7 +-- .../test/index/36_external_gte_version.yml | 7 +-- .../rest-api-spec/test/index/40_routing.yml | 6 +-- .../rest-api-spec/test/index/60_refresh.yml | 14 ++---- .../test/indices.create/10_basic.yml | 15 ++---- .../test/indices.get_mapping/10_basic.yml | 3 +- .../test/indices.put_mapping/10_basic.yml | 10 ++-- .../indices.put_mapping/all_path_options.yml | 3 +- .../test/search/220_no_types.yml | 46 ------------------- .../rest-api-spec/test/update/10_doc.yml | 17 +------ .../test/update/11_shard_header.yml | 6 +-- .../rest-api-spec/test/update/12_result.yml | 7 +-- .../test/update/20_doc_upsert.yml | 7 +-- .../test/update/22_doc_as_upsert.yml | 7 +-- .../test/update/30_internal_version.yml | 5 +- .../test/update/35_other_versions.yml | 4 +- .../rest-api-spec/test/update/40_routing.yml | 6 +-- .../rest-api-spec/test/update/60_refresh.yml | 17 ++----- .../test/update/80_source_filtering.yml | 4 +- .../test/update/85_fields_meta.yml | 2 - .../action/DocWriteResponse.java | 4 +- .../elasticsearch/index/get/GetResult.java | 4 +- .../rest/action/document/RestBulkAction.java | 5 -- .../action/document/RestDeleteAction.java | 11 ++--- .../rest/action/document/RestGetAction.java | 11 ++--- .../action/document/RestUpdateAction.java | 11 ++--- .../rest/action/search/RestSearchAction.java | 5 -- .../org/elasticsearch/search/SearchHit.java | 2 +- 63 files changed, 101 insertions(+), 430 deletions(-) delete mode 100644 rest-api-spec/src/main/resources/rest-api-spec/test/search/220_no_types.yml diff --git a/docs/reference/mapping/removal_of_types.asciidoc b/docs/reference/mapping/removal_of_types.asciidoc index 95881ba83856f..75690875e0eb8 100644 --- a/docs/reference/mapping/removal_of_types.asciidoc +++ b/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 <>, <>, -<> and <> APIs do not return a `_type` -key in the response when `include_type_name` is set to `false`. +The <>, <>, <> and <> 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. diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json b/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json index 96c88ae933840..a07f362bef064 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json +++ b/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)" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json b/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json index b146c34b441ea..6554fa659ec67 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/delete.json +++ b/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)" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/get.json b/rest-api-spec/src/main/resources/rest-api-spec/api/get.json index 65b0261985656..f97caede15a30 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/get.json +++ b/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" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/index.json b/rest-api-spec/src/main/resources/rest-api-spec/api/index.json index 3e07ff7acfa37..574206a0dc3ed 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/index.json +++ b/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)" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/search.json b/rest-api-spec/src/main/resources/rest-api-spec/api/search.json index a1fdf7dbd83c6..5a576e8ce3c38 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/search.json +++ b/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" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/update.json b/rest-api-spec/src/main/resources/rest-api-spec/api/update.json index f1294e57cd30c..2d13b49e3cbbc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/update.json +++ b/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)" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/10_basic.yml index 536cb28d5484b..e8593c4c8d5ff 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/10_basic.yml +++ b/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} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/20_list_of_strings.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/20_list_of_strings.yml index 742cf49c38e53..b23517f6a8f25 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/20_list_of_strings.yml +++ b/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"}}' diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/30_big_string.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/30_big_string.yml index 15a70fa3f378e..38706d133e44b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/30_big_string.yml +++ b/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"}} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/40_source.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/40_source.yml index 3811eb8a18cc4..5e783d60d3d46 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/40_source.yml +++ b/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: | diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/50_refresh.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/50_refresh.yml index 059794873add7..77098779c0c4f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/50_refresh.yml +++ b/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"}} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/10_basic.yml index 7f5d13125c3d4..842d749d7b14d 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/10_basic.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/11_shard_header.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/11_shard_header.yml index c235b8ebfbf23..e3f210966563e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/11_shard_header.yml +++ b/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} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/12_result.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/12_result.yml index f6d4fffb68af8..13356cd938c48 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/12_result.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/20_internal_version.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/20_internal_version.yml index c21617bcac621..afe69b4fe82e5 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/20_internal_version.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/25_external_version.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/25_external_version.yml index c2cae2b6e1e5d..d7cc4fce0eda5 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/25_external_version.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/26_external_gte_version.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/26_external_gte_version.yml index df119a57c12ce..ebe1680551c96 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/26_external_gte_version.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/30_routing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/30_routing.yml index a0ad089b0fbe8..f1647b8edac85 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/30_routing.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/50_refresh.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/50_refresh.yml index 326186bf07bf3..121959d2d976b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/50_refresh.yml +++ b/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 }} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/60_missing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/60_missing.yml index 46b238482d76b..b8f81080f3ee8 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/60_missing.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/10_basic.yml index 71403f0b56f78..9183c70c29bce 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/10_basic.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/15_default_values.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/15_default_values.yml index fbab99fc3c6ed..67065270665cf 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/15_default_values.yml +++ b/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" } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/20_stored_fields.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/20_stored_fields.yml index 20971728ffd96..7dd782652bf99 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/20_stored_fields.yml +++ b/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] diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/40_routing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/40_routing.yml index 941623142259b..61b4fc8a1597a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/40_routing.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/50_with_headers.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/50_with_headers.yml index bd26eee1b5dd2..38130cee59810 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/50_with_headers.yml +++ b/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} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/60_realtime_refresh.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/60_realtime_refresh.yml index c5955bf4d7a70..a1647835536e1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/60_realtime_refresh.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/70_source_filtering.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/70_source_filtering.yml index f9247d1076159..4090636f1c21f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/70_source_filtering.yml +++ b/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 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/80_missing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/80_missing.yml index 48a6966b455b0..d7d8edfc65dcb 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/80_missing.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/90_versions.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/90_versions.yml index 6975d4f5be518..9037a9113e937 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/90_versions.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/10_with_id.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/10_with_id.yml index 0deb76376945b..a129dcab80d9a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/10_with_id.yml +++ b/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 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/12_result.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/12_result.yml index 7198c694b511a..f8a50415a95ef 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/12_result.yml +++ b/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 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/15_without_id.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/15_without_id.yml index 3bd607c66fac7..073a4704b4ef8 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/15_without_id.yml +++ b/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 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/20_optype.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/20_optype.yml index ddab362b80f9f..c33a86093acab 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/20_optype.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/30_internal_version.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/30_internal_version.yml index 53351c24feb35..adc4f3f4b15c0 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/30_internal_version.yml +++ b/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 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/35_external_version.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/35_external_version.yml index 054f8cad15ddf..89aaa190af384 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/35_external_version.yml +++ b/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 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/36_external_gte_version.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/36_external_gte_version.yml index 67f534db341df..82421227adb7f 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/36_external_gte_version.yml +++ b/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 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/40_routing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/40_routing.yml index 523cf47f8582d..c3b577df4fe2c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/40_routing.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/60_refresh.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/60_refresh.yml index 346338791d61c..ec52d0cae89a9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/60_refresh.yml +++ b/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 }} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/10_basic.yml index a96c31e9ce6ab..e58e2bd8aa1fc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/10_basic.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml index 36f45dd0e6018..ccebfc7c9423b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.get_mapping/10_basic.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml index 7588c66188546..e4545320a973c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/10_basic.yml +++ b/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 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml index c4133e8d01be5..c6212fbbd8fa5 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.put_mapping/all_path_options.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search/220_no_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search/220_no_types.yml deleted file mode 100644 index b2489d2ad012e..0000000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search/220_no_types.yml +++ /dev/null @@ -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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/10_doc.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/10_doc.yml index dd5ada3b1f1e9..3a35ad46f9161 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/10_doc.yml +++ b/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 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/11_shard_header.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/11_shard_header.yml index 69f8f7c6427f3..4afe78ca7d30a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/11_shard_header.yml +++ b/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} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/12_result.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/12_result.yml index db4b56eedd391..657c036291bd6 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/12_result.yml +++ b/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: diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/20_doc_upsert.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/20_doc_upsert.yml index 1595e9d6f8a3f..a849eecc66629 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/20_doc_upsert.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/22_doc_as_upsert.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/22_doc_as_upsert.yml index 884fa3e16f6e8..5bdc3ecea75fc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/22_doc_as_upsert.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/30_internal_version.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/30_internal_version.yml index 20ff2020932d4..7b474d6bc09dc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/30_internal_version.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/35_other_versions.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/35_other_versions.yml index 904d3ce4b4f7a..9740aa39edeb3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/35_other_versions.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/40_routing.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/40_routing.yml index 643d79239d0e4..374390f4b9716 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/40_routing.yml +++ b/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 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/60_refresh.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/60_refresh.yml index 8039edc2e3a05..b590d01f93a7a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/60_refresh.yml +++ b/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 } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/80_source_filtering.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/80_source_filtering.yml index c69984e5cde39..9e6d5a4671955 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/80_source_filtering.yml +++ b/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] diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/85_fields_meta.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/85_fields_meta.yml index 7838c20085103..14b096211c5c2 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/85_fields_meta.yml +++ b/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 diff --git a/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java b/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java index 7273bf29462ac..4abc01ff0134d 100644 --- a/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java +++ b/server/src/main/java/org/elasticsearch/action/DocWriteResponse.java @@ -296,9 +296,7 @@ public final XContentBuilder toXContent(XContentBuilder builder, Params params) 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()); diff --git a/server/src/main/java/org/elasticsearch/index/get/GetResult.java b/server/src/main/java/org/elasticsearch/index/get/GetResult.java index ba5c4cd929fd2..ba70c7035506b 100644 --- a/server/src/main/java/org/elasticsearch/index/get/GetResult.java +++ b/server/src/main/java/org/elasticsearch/index/get/GetResult.java @@ -256,9 +256,7 @@ public XContentBuilder toXContentEmbedded(XContentBuilder builder, Params params 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) { diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java index 0e242bb6d9f78..74c30a9f5d0e1 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java @@ -73,11 +73,6 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC 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; } diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java index 05b60d3d7cbb2..1ff0fdf280489 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java @@ -24,7 +24,6 @@ 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 String getName() { @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")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java index 8044600d6196e..0a21188f54563 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java @@ -25,7 +25,6 @@ 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 String getName() { @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")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java index 29cc6e8e028a8..b672445421af8 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java @@ -25,7 +25,6 @@ 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 String getName() { @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")); diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java index 3efa9e633de30..0a0bf1b6e38eb 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java @@ -150,13 +150,8 @@ public static void parseSearchRequest(SearchRequest searchRequest, RestRequest r 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)); diff --git a/server/src/main/java/org/elasticsearch/search/SearchHit.java b/server/src/main/java/org/elasticsearch/search/SearchHit.java index 71ea55e97a762..7eb1139705dfc 100644 --- a/server/src/main/java/org/elasticsearch/search/SearchHit.java +++ b/server/src/main/java/org/elasticsearch/search/SearchHit.java @@ -429,7 +429,7 @@ public XContentBuilder toInnerXContent(XContentBuilder builder, Params params) t 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) {