Skip to content

Commit 7719f17

Browse files
Deprecate legacy params from range query (#113286) (#113610)
Deprecate to, from, include_lower, include_upper range query params. These params have been removed from our documentation in v. 0.90.4 (d6ecdec), but did not got through deprecation cycle. These params to be removed in v9.0. Related to #81276 Closes #48538
1 parent ff92618 commit 7719f17

File tree

15 files changed

+69
-60
lines changed

15 files changed

+69
-60
lines changed

docs/changelog/113286.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pr: 113286
2+
summary: Deprecate legacy params from range query
3+
area: Search
4+
type: deprecation
5+
issues: []
6+
deprecation:
7+
title: Deprecate legacy params from range query
8+
area: REST API
9+
details: Range query will not longer accept `to`, `from`, `include_lower`, and `include_upper` parameters.
10+
impact: Instead use `gt`, `gte`, `lt` and `lte` parameters.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ Example:
165165
POST /sales/_search?size=0
166166
{
167167
"query": {
168-
"constant_score": { "filter": { "range": { "price": { "to": "500" } } } }
168+
"constant_score": { "filter": { "range": { "price": { "lte": "500" } } } }
169169
},
170170
"aggs": {
171171
"prices": {
@@ -202,7 +202,7 @@ Example:
202202
POST /sales/_search?size=0
203203
{
204204
"query": {
205-
"constant_score": { "filter": { "range": { "price": { "to": "500" } } } }
205+
"constant_score": { "filter": { "range": { "price": { "lte": "500" } } } }
206206
},
207207
"aggs": {
208208
"prices": {

docs/reference/watcher/getting-started.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ GET .watcher-history*/_search?pretty
135135
"bool" : {
136136
"must" : [
137137
{ "match" : { "result.condition.met" : true }},
138-
{ "range" : { "result.execution_time" : { "from" : "now-10s" }}}
138+
{ "range" : { "result.execution_time" : { "gte" : "now-10s" }}}
139139
]
140140
}
141141
}

docs/reference/watcher/transform/search.asciidoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ time of the watch:
119119
{
120120
"range" : {
121121
"@timestamp" : {
122-
"from" : "{{ctx.trigger.scheduled_time}}||-30s",
123-
"to" : "{{ctx.trigger.triggered_time}}"
122+
"gte" : "{{ctx.trigger.scheduled_time}}||-30s",
123+
"lte" : "{{ctx.trigger.triggered_time}}"
124124
}
125125
}
126126
}
@@ -159,8 +159,8 @@ The following is an example of using templates that refer to provided parameters
159159
{
160160
"range" : {
161161
"@timestamp" : {
162-
"from" : "{{ctx.trigger.scheduled_time}}||-30s",
163-
"to" : "{{ctx.trigger.triggered_time}}"
162+
"gte" : "{{ctx.trigger.scheduled_time}}||-30s",
163+
"lte" : "{{ctx.trigger.triggered_time}}"
164164
}
165165
}
166166
}

modules/rank-eval/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,7 @@ testClusters.configureEach {
2525
// Modules who's integration is explicitly tested in integration tests
2626
module ':modules:lang-mustache'
2727
}
28+
29+
tasks.named("yamlRestTestV7CompatTransform").configure({ task ->
30+
task.skipTest("rank_eval/30_failures/Response format", "warning does not exist for compatibility")
31+
})

modules/rank-eval/src/yamlRestTest/resources/rest-api-spec/test/rank_eval/30_failures.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
{
2323
"id" : "invalid_query",
24-
"request": { "query": { "range" : { "bar" : { "from" : "Basel", "time_zone": "+01:00" }}}},
24+
"request": { "query": { "range" : { "bar" : { "gte" : "Basel", "time_zone": "+01:00" }}}},
2525
"ratings": [{"_index": "foo", "_id": "doc1", "rating": 1}]
2626
}
2727
],

modules/runtime-fields-common/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ tasks.named("yamlRestTestV7CompatTransform").configure { task ->
2828
task.skipTest("runtime_fields/101_geo_point_from_source/fetch fields from source", "Format changed. Old format was a bug.")
2929
task.skipTest("runtime_fields/102_geo_point_source_in_query/fetch fields from source", "Format changed. Old format was a bug.")
3030
task.skipTest("runtime_fields/103_geo_point_calculated_at_index/fetch fields from source", "Format changed. Old format was a bug.")
31+
task.skipTestsByFilePattern("**/runtime_fields/110_composite.yml", "warning does not exist for compatibility")
3132
}

modules/runtime-fields-common/src/yamlRestTest/resources/rest-api-spec/test/runtime_fields/110_composite.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ query:
8383
query:
8484
range:
8585
http.clientip:
86-
from: 232.0.0.0
87-
to: 253.0.0.0
86+
gte: 232.0.0.0
87+
lte: 253.0.0.0
8888
- match: { hits.total.value: 4 }
8989

9090
---

rest-api-spec/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,7 @@ tasks.named("precommit").configure {
244244
dependsOn 'enforceYamlTestConvention'
245245
}
246246

247+
tasks.named("yamlRestTestV7CompatTransform").configure({ task ->
248+
task.skipTest("indices.sort/10_basic/Index Sort", "warning does not exist for compatibility")
249+
task.skipTest("search/330_fetch_fields/Test search rewrite", "warning does not exist for compatibility")
250+
})

rest-api-spec/src/yamlRestTest/resources/rest-api-spec/test/indices.sort/10_basic.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
index: test
102102
body:
103103
sort: ["rank"]
104-
query: {"range": { "rank": { "from": 0 } } }
104+
query: {"range": { "rank": { "gte": 0 } } }
105105
track_total_hits: false
106106
size: 1
107107

@@ -142,7 +142,7 @@
142142
index: test
143143
body:
144144
sort: ["rank"]
145-
query: {"range": { "rank": { "from": 0 } } }
145+
query: {"range": { "rank": { "gte": 0 } } }
146146
track_total_hits: false
147147
size: 3
148148

@@ -160,6 +160,6 @@
160160
scroll: 1m
161161
body:
162162
sort: ["rank"]
163-
query: {"range": { "rank": { "from": 0 } } }
163+
query: {"range": { "rank": { "gte": 0 } } }
164164
track_total_hits: false
165165
size: 3

0 commit comments

Comments
 (0)