Skip to content

Commit 540ba21

Browse files
committed
Remove include_type_name from the relevant APIs.
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.
1 parent 3c36ba1 commit 540ba21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+101
-430
lines changed

docs/reference/mapping/removal_of_types.asciidoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,12 @@ The above call returns
495495
[float]
496496
==== Document APIs
497497

498-
Index APIs must be call with the `{index}/_doc` path for automatic generation of
498+
Index APIs must be called with the `{index}/_doc` path for automatic generation of
499499
the `_id` and `{index}/_doc/{id}` with explicit ids.
500500

501501
[source,js]
502502
--------------------------------------------------
503-
PUT index/_doc/1?include_type_name=false
503+
PUT index/_doc/1
504504
{
505505
"foo": "bar"
506506
}
@@ -512,6 +512,7 @@ PUT index/_doc/1?include_type_name=false
512512
{
513513
"_index": "index", <1>
514514
"_id": "1",
515+
"_type": "_doc",
515516
"_version": 1,
516517
"result": "created",
517518
"_shards": {
@@ -526,6 +527,6 @@ PUT index/_doc/1?include_type_name=false
526527
// TESTRESPONSE
527528
<1> The response does not include a `_type`.
528529

529-
Likewise the <<docs-index_,GET>>, <<docs-delete,`DELETE`>>,
530-
<<docs-update,`_update`>> and <<search,`_search`>> APIs do not return a `_type`
531-
key in the response when `include_type_name` is set to `false`.
530+
The <<docs-index_,GET>>, <<docs-delete,`DELETE`>>, <<docs-update,`_update`>> and <<search,`_search`>> APIs
531+
will continue to return a `_type` key in the response in 7.0, but it is considered deprecated and will be
532+
removed in 8.0.

rest-api-spec/src/main/resources/rest-api-spec/api/bulk.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
}
1717
},
1818
"params": {
19-
"include_type_name": {
20-
"type" : "string",
21-
"description" : "Whether to add the type name to the response"
22-
},
2319
"wait_for_active_shards": {
2420
"type" : "string",
2521
"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)"

rest-api-spec/src/main/resources/rest-api-spec/api/delete.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
}
2323
},
2424
"params": {
25-
"include_type_name": {
26-
"type" : "string",
27-
"description" : "Whether to add the type name to the response"
28-
},
2925
"wait_for_active_shards": {
3026
"type" : "string",
3127
"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)"

rest-api-spec/src/main/resources/rest-api-spec/api/get.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
}
2323
},
2424
"params": {
25-
"include_type_name": {
26-
"type" : "string",
27-
"description" : "Whether to add the type name to the response"
28-
},
2925
"stored_fields": {
3026
"type": "list",
3127
"description" : "A comma-separated list of stored fields to return in the response"

rest-api-spec/src/main/resources/rest-api-spec/api/index.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
}
2222
},
2323
"params": {
24-
"include_type_name": {
25-
"type" : "string",
26-
"description" : "Whether to add the type name to the response"
27-
},
2824
"wait_for_active_shards": {
2925
"type" : "string",
3026
"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)"

rest-api-spec/src/main/resources/rest-api-spec/api/search.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
}
1717
},
1818
"params": {
19-
"include_type_name": {
20-
"type" : "string",
21-
"description" : "Whether to add the type name to the response"
22-
},
2319
"analyzer": {
2420
"type" : "string",
2521
"description" : "The analyzer to use for the query string"

rest-api-spec/src/main/resources/rest-api-spec/api/update.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
}
2323
},
2424
"params": {
25-
"include_type_name": {
26-
"type" : "string",
27-
"description" : "Whether to add the type name to the response"
28-
},
2925
"wait_for_active_shards": {
3026
"type": "string",
3127
"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)"

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33

44
- skip:
55
version: " - 6.99.99"
6-
reason: include_type_name was introduced in 7.0.0
6+
reason: types are required in requests before 7.0.0
77

88
- do:
99
bulk:
10-
include_type_name: false
1110
refresh: true
1211
body:
1312
- index:
@@ -32,11 +31,10 @@
3231

3332
- skip:
3433
version: " - 6.99.99"
35-
reason: include_type_name was introduced in 7.0.0
34+
reason: types are required in requests before 7.0.0
3635

3736
- do:
3837
bulk:
39-
include_type_name: false
4038
refresh: true
4139
body:
4240
- index:
@@ -69,14 +67,13 @@
6967
- skip:
7068
version: " - 6.99.99"
7169
features: headers
72-
reason: include_type_name was introduced in 7.0.0
70+
reason: types are required in requests before 7.0.0
7371

7472
- do:
7573
catch: /Malformed action\/metadata line \[3\], expected FIELD_NAME but found \[END_OBJECT\]/
7674
headers:
7775
Content-Type: application/json
7876
bulk:
79-
include_type_name: false
8077
body: |
8178
{"index": {"_index": "test_index", "_id": "test_id"}}
8279
{"f1": "v1", "f2": 42}

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33

44
- skip:
55
version: " - 6.99.99"
6-
reason: include_type_name was introduced in 7.0.0
7-
6+
reason: types are required in requests before 7.0.0
87
- do:
98
bulk:
10-
include_type_name: false
119
refresh: true
1210
body:
1311
- '{"index": {"_index": "test_index", "_id": "test_id"}}'

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@
33

44
- skip:
55
version: " - 6.99.99"
6-
reason: include_type_name was introduced in 7.0.0
7-
6+
reason: types are required in requests before 7.0.0
87
- do:
98
bulk:
10-
include_type_name: false
119
refresh: true
1210
body: |
1311
{"index": {"_index": "test_index", "_id": "test_id"}}

0 commit comments

Comments
 (0)