Skip to content

Commit ebd6b5b

Browse files
authored
Deprecate filtering on _type. (#29468)
As indices are only allowed to have one type now, and types are going away in the future, we should deprecate filtering by `_type`. Relates #15613
1 parent d44bbb7 commit ebd6b5b

File tree

29 files changed

+51
-99
lines changed

29 files changed

+51
-99
lines changed

docs/painless/painless-getting-started.asciidoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ their last name:
239239

240240
[source,js]
241241
----------------------------------------------------------------
242-
POST hockey/player/_update_by_query
242+
POST hockey/_update_by_query
243243
{
244244
"script": {
245245
"lang": "painless",
@@ -260,7 +260,7 @@ names start with a consonant and end with a vowel:
260260

261261
[source,js]
262262
----------------------------------------------------------------
263-
POST hockey/player/_update_by_query
263+
POST hockey/_update_by_query
264264
{
265265
"script": {
266266
"lang": "painless",
@@ -281,7 +281,7 @@ remove all of the vowels in all of their last names:
281281

282282
[source,js]
283283
----------------------------------------------------------------
284-
POST hockey/player/_update_by_query
284+
POST hockey/_update_by_query
285285
{
286286
"script": {
287287
"lang": "painless",
@@ -297,7 +297,7 @@ method so it supports `$1` and `\1` for replacements:
297297

298298
[source,js]
299299
----------------------------------------------------------------
300-
POST hockey/player/_update_by_query
300+
POST hockey/_update_by_query
301301
{
302302
"script": {
303303
"lang": "painless",
@@ -319,7 +319,7 @@ This will make all of the vowels in the hockey player's last names upper case:
319319

320320
[source,js]
321321
----------------------------------------------------------------
322-
POST hockey/player/_update_by_query
322+
POST hockey/_update_by_query
323323
{
324324
"script": {
325325
"lang": "painless",
@@ -337,7 +337,7 @@ last names upper case:
337337

338338
[source,js]
339339
----------------------------------------------------------------
340-
POST hockey/player/_update_by_query
340+
POST hockey/_update_by_query
341341
{
342342
"script": {
343343
"lang": "painless",

docs/reference/aggregations/bucket/significanttext-aggregation.asciidoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Example:
3838

3939
[source,js]
4040
--------------------------------------------------
41-
GET news/article/_search
41+
GET news/_search
4242
{
4343
"query" : {
4444
"match" : {"content" : "Bird flu"}
@@ -153,7 +153,7 @@ We can drill down into examples of these documents to see why pozmantier is conn
153153

154154
[source,js]
155155
--------------------------------------------------
156-
GET news/article/_search
156+
GET news/_search
157157
{
158158
"query": {
159159
"simple_query_string": {
@@ -221,7 +221,7 @@ with the `filter_duplicate_text` setting turned on:
221221

222222
[source,js]
223223
--------------------------------------------------
224-
GET news/article/_search
224+
GET news/_search
225225
{
226226
"query": {
227227
"match": {
@@ -424,7 +424,7 @@ context:
424424

425425
[source,js]
426426
--------------------------------------------------
427-
GET news/article/_search
427+
GET news/_search
428428
{
429429
"query" : {
430430
"match" : {
@@ -463,7 +463,7 @@ will be analyzed using the `source_fields` parameter:
463463

464464
[source,js]
465465
--------------------------------------------------
466-
GET news/article/_search
466+
GET news/_search
467467
{
468468
"query" : {
469469
"match" : {

docs/reference/aggregations/metrics/percentile-rank-aggregation.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ had a value.
217217

218218
[source,js]
219219
--------------------------------------------------
220-
GET latency/data/_search
220+
GET latency/_search
221221
{
222222
"size": 0,
223223
"aggs" : {

docs/reference/docs/delete-by-query.asciidoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Back to the API format, this will delete tweets from the `twitter` index:
7575

7676
[source,js]
7777
--------------------------------------------------
78-
POST twitter/_doc/_delete_by_query?conflicts=proceed
78+
POST twitter/_delete_by_query?conflicts=proceed
7979
{
8080
"query": {
8181
"match_all": {}
@@ -85,12 +85,12 @@ POST twitter/_doc/_delete_by_query?conflicts=proceed
8585
// CONSOLE
8686
// TEST[setup:twitter]
8787

88-
It's also possible to delete documents of multiple indexes and multiple
89-
types at once, just like the search API:
88+
It's also possible to delete documents of multiple indexes at once, just like
89+
the search API:
9090

9191
[source,js]
9292
--------------------------------------------------
93-
POST twitter,blog/_docs,post/_delete_by_query
93+
POST twitter,blog/_delete_by_query
9494
{
9595
"query": {
9696
"match_all": {}

docs/reference/docs/update-by-query.asciidoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Back to the API format, this will update tweets from the `twitter` index:
6767

6868
[source,js]
6969
--------------------------------------------------
70-
POST twitter/_doc/_update_by_query?conflicts=proceed
70+
POST twitter/_update_by_query?conflicts=proceed
7171
--------------------------------------------------
7272
// CONSOLE
7373
// TEST[setup:twitter]
@@ -145,12 +145,12 @@ This API doesn't allow you to move the documents it touches, just modify their
145145
source. This is intentional! We've made no provisions for removing the document
146146
from its original location.
147147

148-
It's also possible to do this whole thing on multiple indexes and multiple
149-
types at once, just like the search API:
148+
It's also possible to do this whole thing on multiple indexes at once, just
149+
like the search API:
150150

151151
[source,js]
152152
--------------------------------------------------
153-
POST twitter,blog/_doc,post/_update_by_query
153+
POST twitter,blog/_update_by_query
154154
--------------------------------------------------
155155
// CONSOLE
156156
// TEST[s/^/PUT twitter\nPUT blog\n/]

docs/reference/search/search.asciidoc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ that match the query. The query can either be provided using a simple
1212
All search APIs can be applied across multiple types within an index, and
1313
across multiple indices with support for the
1414
<<multi-index,multi index syntax>>. For
15-
example, we can search on all documents across all types within the
16-
twitter index:
15+
example, we can search on all documents within the twitter index:
1716

1817
[source,js]
1918
--------------------------------------------------
@@ -22,15 +21,6 @@ GET /twitter/_search?q=user:kimchy
2221
// CONSOLE
2322
// TEST[setup:twitter]
2423

25-
We can also search within specific types:
26-
27-
[source,js]
28-
--------------------------------------------------
29-
GET /twitter/tweet,user/_search?q=user:kimchy
30-
--------------------------------------------------
31-
// CONSOLE
32-
// TEST[setup:twitter]
33-
3424
We can also search all tweets with a certain tag across several indices
3525
(for example, when each user has his own index):
3626

modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/20_empty_bucket.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@
3535
- do:
3636
search:
3737
index: empty_bucket_idx
38-
type: test
3938

4039
- match: {hits.total: 2}
4140

4241
- do:
4342
search:
4443
index: empty_bucket_idx
45-
type: test
4644
body: {"aggs": {"histo": {"histogram": {"field": "val1", "interval": 1, "min_doc_count": 0}, "aggs": { "mfs" : { "matrix_stats": {"fields": ["value", "val1"]} } } } } }
4745

4846
- match: {hits.total: 2}

modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/30_single_value_field.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ setup:
130130
- do:
131131
search:
132132
index: unmapped
133-
type: test
134133
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "val2", "val3"]} } } }
135134

136135
- match: {hits.total: 0}
@@ -142,7 +141,6 @@ setup:
142141
- do:
143142
search:
144143
index: test
145-
type: test
146144
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "val3"]} } } }
147145

148146
- match: {hits.total: 15}
@@ -155,7 +153,6 @@ setup:
155153
- do:
156154
search:
157155
index: [test, unmapped]
158-
type: test
159156
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "val2", "val3"]} } } }
160157

161158
- match: {hits.total: 15}
@@ -169,7 +166,6 @@ setup:
169166
- do:
170167
search:
171168
index: [test, unmapped]
172-
type: test
173169
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "val2", "val3"], "missing" : {"val2" : 10} } } } }
174170

175171
- match: {hits.total: 15}
@@ -184,7 +180,6 @@ setup:
184180
catch: /parsing_exception/
185181
search:
186182
index: test
187-
type: test
188183
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "val2"], "script" : { "my_script" : {"source" : "1 + doc['val1'].value", "lang" : "js"} } } } } }
189184

190185
---
@@ -194,5 +189,4 @@ setup:
194189
catch: /parsing_exception/
195190
search:
196191
index: test
197-
type: test
198192
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "val2", "val3"], "script" : { "my_script" : {"source" : "my_var + doc['val1'].value", "params" : { "my_var" : 1 }, "lang" : "js" } } } } } }

modules/aggs-matrix-stats/src/test/resources/rest-api-spec/test/stats/40_multi_value_field.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ setup:
130130
- do:
131131
search:
132132
index: unmapped
133-
type: test
134133
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "val2", "vals"]} } } }
135134

136135
- match: {hits.total: 0}
@@ -142,7 +141,6 @@ setup:
142141
- do:
143142
search:
144143
index: test
145-
type: test
146144
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "vals"], "mode" : "max"} } } }
147145

148146
- match: {hits.total: 15}
@@ -156,7 +154,6 @@ setup:
156154
- do:
157155
search:
158156
index: test
159-
type: test
160157
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "vals"], "mode" : "min"} } } }
161158

162159
- match: {hits.total: 15}
@@ -170,7 +167,6 @@ setup:
170167
- do:
171168
search:
172169
index: [test, unmapped]
173-
type: test
174170
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "val2", "vals"]} } } }
175171

176172
- match: {hits.total: 15}
@@ -184,7 +180,6 @@ setup:
184180
- do:
185181
search:
186182
index: [test, unmapped]
187-
type: test
188183
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "val2", "vals"], "missing" : {"val2" : 10, "vals" : 5 } } } } }
189184

190185
- match: {hits.total: 15}
@@ -199,7 +194,6 @@ setup:
199194
catch: /parsing_exception/
200195
search:
201196
index: test
202-
type: test
203197
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["vals", "val3"], "script" : { "my_script" : {"source" : "1 + doc['val1'].value", "lang" : "js"} } } } } }
204198

205199
---
@@ -209,5 +203,4 @@ setup:
209203
catch: /parsing_exception/
210204
search:
211205
index: test
212-
type: test
213206
body: {"aggs": { "mfs" : { "matrix_stats": {"fields": ["val1", "val3", "vals"], "script" : { "my_script" : {"source" : "my_var + doc['val1'].value", "params" : { "my_var" : 1 }, "lang" : "js" } } } } } }

rest-api-spec/src/main/resources/rest-api-spec/test/create/60_refresh.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
- do:
1919
search:
2020
index: test_1
21-
type: test
2221
body:
2322
query: { term: { _id: 1 }}
2423

@@ -36,7 +35,6 @@
3635
- do:
3736
search:
3837
index: test_1
39-
type: test
4038
body:
4139
query: { term: { _id: 2 }}
4240

@@ -56,7 +54,6 @@
5654
- do:
5755
search:
5856
index: test_1
59-
type: test
6057
body:
6158
query: { term: { _id: 1 }}
6259

@@ -76,7 +73,6 @@
7673
- do:
7774
search:
7875
index: create_60_refresh_1
79-
type: test
8076
body:
8177
query: { term: { _id: create_60_refresh_id1 }}
8278
- match: { hits.total: 1 }

0 commit comments

Comments
 (0)