Skip to content

Commit c18c531

Browse files
Deprecate legacy params from range query (#113286)
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 437ce66 commit c18c531

File tree

16 files changed

+73
-60
lines changed

16 files changed

+73
-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("yamlRestCompatTestTransform").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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,7 @@ dependencies {
2222
api project(':libs:elasticsearch-grok')
2323
api project(':libs:elasticsearch-dissect')
2424
}
25+
26+
tasks.named("yamlRestCompatTestTransform").configure({ task ->
27+
task.skipTestsByFilePattern("**/runtime_fields/110_composite.yml", "warning does not exist for compatibility")
28+
})

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
---

muted-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ tests:
266266
- class: org.elasticsearch.xpack.ml.integration.MlJobIT
267267
method: testDeleteJob_TimingStatsDocumentIsDeleted
268268
issue: https://github.com/elastic/elasticsearch/issues/113370
269+
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
270+
method: test {p0=search/500_date_range/from, to, include_lower, include_upper deprecated}
271+
issue: https://github.com/elastic/elasticsearch/pull/113286
269272
- class: org.elasticsearch.xpack.esql.EsqlAsyncSecurityIT
270273
method: testLimitedPrivilege
271274
issue: https://github.com/elastic/elasticsearch/issues/113419

rest-api-spec/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,6 @@ tasks.named("precommit").configure {
5656

5757
tasks.named("yamlRestCompatTestTransform").configure({ task ->
5858
task.skipTest("tsdb/140_routing_path/multi-value routing path field", "Multi-value routing paths are allowed now. See #112645")
59+
task.skipTest("indices.sort/10_basic/Index Sort", "warning does not exist for compatibility")
60+
task.skipTest("search/330_fetch_fields/Test search rewrite", "warning does not exist for compatibility")
5961
})

0 commit comments

Comments
 (0)