Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/changelog/113286.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pr: 113286
summary: Deprecate legacy params from range query
area: Search
type: deprecation
issues: []
deprecation:
title: Deprecate legacy params from range query
area: Search
details: Please describe the details of this change for the release notes. You can
use asciidoc.
impact: Please describe the impact of this change to users
8 changes: 4 additions & 4 deletions docs/reference/watcher/transform/search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ time of the watch:
{
"range" : {
"@timestamp" : {
"from" : "{{ctx.trigger.scheduled_time}}||-30s",
"to" : "{{ctx.trigger.triggered_time}}"
"gte" : "{{ctx.trigger.scheduled_time}}||-30s",
"lte" : "{{ctx.trigger.triggered_time}}"
}
}
}
Expand Down Expand Up @@ -159,8 +159,8 @@ The following is an example of using templates that refer to provided parameters
{
"range" : {
"@timestamp" : {
"from" : "{{ctx.trigger.scheduled_time}}||-30s",
"to" : "{{ctx.trigger.triggered_time}}"
"gte" : "{{ctx.trigger.scheduled_time}}||-30s",
"lte" : "{{ctx.trigger.triggered_time}}"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
query:
range:
date:
from: "1990-12-29T22:30:00.000Z"
gte: "1990-12-29T22:30:00.000Z"
fields:
- field: date
format: "yyyy/MM/dd"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,29 @@ setup:
- match: { hits.total: 1 }
- length: { hits.hits: 1 }
- match: { hits.hits.0._id: "4" }


---
"from, to, include_lower, include_upper deprecated":
- requires:
cluster_features: "gte_v8.16.0"
reason: 'from, to, include_lower, include_upper parameters are deprecated since 8.16.0'
test_runner_features: warnings

- do:
warnings:
- "Deprecated field [from] used, this field is unused and will be removed entirely"
- "Deprecated field [to] used, this field is unused and will be removed entirely"
- "Deprecated field [include_lower] used, this field is unused and will be removed entirely"
- "Deprecated field [include_upper] used, this field is unused and will be removed entirely"
search:
index: dates
body:
sort: field
query:
range:
date:
from: 1000
to: 2023
include_lower: false
include_upper: false
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ public class RangeQueryBuilder extends AbstractQueryBuilder<RangeQueryBuilder> i

public static final ParseField LTE_FIELD = new ParseField("lte");
public static final ParseField GTE_FIELD = new ParseField("gte");
public static final ParseField FROM_FIELD = new ParseField("from");
public static final ParseField TO_FIELD = new ParseField("to");
private static final ParseField INCLUDE_LOWER_FIELD = new ParseField("include_lower");
private static final ParseField INCLUDE_UPPER_FIELD = new ParseField("include_upper");
public static final ParseField FROM_FIELD = new ParseField("from").withAllDeprecated();
public static final ParseField TO_FIELD = new ParseField("to").withAllDeprecated();
private static final ParseField INCLUDE_LOWER_FIELD = new ParseField("include_lower").withAllDeprecated();
private static final ParseField INCLUDE_UPPER_FIELD = new ParseField("include_upper").withAllDeprecated();
public static final ParseField GT_FIELD = new ParseField("gt");
public static final ParseField LT_FIELD = new ParseField("lt");
private static final ParseField TIME_ZONE_FIELD = new ParseField("time_zone");
Expand Down