[DOCS] Deprecated the from/to/include_lower/include_upper params

in the range query, range filter and numeric range filter.
Better to use gt/gte/lt/lte as they are explicit.
This commit is contained in:
Clinton Gormley 2013-09-12 15:07:15 +02:00
parent 169cd007b5
commit d6ecdecc19
3 changed files with 30 additions and 88 deletions

View file

@ -14,10 +14,8 @@ differently.
"filter" : { "filter" : {
"numeric_range" : { "numeric_range" : {
"age" : { "age" : {
"from" : "10", "gte": 10,
"to" : "20", "lte": 20
"include_lower" : true,
"include_upper" : false
} }
} }
} }
@ -33,29 +31,15 @@ performance. Note, if the relevant field values have already been loaded
to memory, for example because it was used in facets or was sorted on, to memory, for example because it was used in facets or was sorted on,
then this filter should be used. then this filter should be used.
The `numeric_range` filter top level parameters include: The `numeric_range` filter accepts the following parameters:
[cols="<,<",options="header",] [horizontal]
|======================================================================= `gte`:: Greater-than or equal to
|Name |Description `gt`:: Greater-than
|`from` |The lower bound. Defaults to start from the first. `lte`:: Less-than or equal to
`lt`:: Less-than
|`to` |The upper bound. Defaults to unbounded. deprecated[0.90.4,The `from`, `to`, `include_lower` and `include_upper` parameters have been deprecated in favour of `gt`,`gte`,`lt`,`lte`]
|`include_lower` |Should the first from (if set) be inclusive or not.
Defaults to `true`
|`include_upper` |Should the last to (if set) be inclusive or not.
Defaults to `true`.
|`gt` |Same as setting `from` and `include_lower` to `false`.
|`gte` |Same as setting `from` and `include_lower` to `true`.
|`lt` |Same as setting `to` and `include_upper` to `false`.
|`lte` |Same as setting `to` and `include_upper` to `true`.
|=======================================================================
[float] [float]
==== Caching ==== Caching

View file

@ -12,11 +12,9 @@ that accept a filter.
"constant_score" : { "constant_score" : {
"filter" : { "filter" : {
"range" : { "range" : {
"age" : { "age" : {
"from" : "10", "gte": 10,
"to" : "20", "lte": 20
"include_lower" : true,
"include_upper" : false
} }
} }
} }
@ -24,33 +22,15 @@ that accept a filter.
} }
-------------------------------------------------- --------------------------------------------------
The `range` filter top level parameters include: The `range` filter accepts the following parameters:
[cols="<,<",options="header",] [horizontal]
|======================================================================= `gte`:: Greater-than or equal to
|Name |Description `gt`:: Greater-than
|`from` |The lower bound. Defaults to start from the first. `lte`:: Less-than or equal to
`lt`:: Less-than
|`to` |The upper bound. Defaults to unbounded. deprecated[0.90.4,The `from`, `to`, `include_lower` and `include_upper` parameters have been deprecated in favour of `gt`,`gte`,`lt`,`lte`]
|`include_lower` |Should the first from (if set) be inclusive or not.
Defaults to `true`
|`include_upper` |Should the last to (if set) be inclusive or not.
Defaults to `true`.
|`gt` |Same as setting `from` to the value, and `include_lower` to
`false`.
|`gte` |Same as setting `from` to the value, and `include_lower` to
`true`.
|`lt` |Same as setting `to` to the value, and `include_upper` to
`false`.
|`lte` |Same as setting `to` to the value, and `include_upper` to
`true`.
|=======================================================================
[float] [float]
==== Caching ==== Caching

View file

@ -11,44 +11,22 @@ a `NumericRangeQuery`. The following example returns all documents where
-------------------------------------------------- --------------------------------------------------
{ {
"range" : { "range" : {
"age" : { "age" : {
"from" : 10, "gte" : 10,
"to" : 20, "lte" : 20,
"include_lower" : true,
"include_upper": false,
"boost" : 2.0 "boost" : 2.0
} }
} }
} }
-------------------------------------------------- --------------------------------------------------
The `range` query top level parameters include: The `range` query accepts the following parameters:
[cols="<,<",options="header",] [horizontal]
|======================================================================= `gte`:: Greater-than or equal to
|Name |Description `gt`:: Greater-than
|`from` |The lower bound. Defaults to start from the first. `lte`:: Less-than or equal to
`lt`:: Less-than
|`to` |The upper bound. Defaults to unbounded. `boost`:: Sets the bool value of the query, defaults to `1.0`
|`include_lower` |Should the first from (if set) be inclusive or not.
Defaults to `true`
|`include_upper` |Should the last to (if set) be inclusive or not.
Defaults to `true`.
|`gt` |Same as setting `from` to the value, and `include_lower` to
`false`.
|`gte` |Same as setting `from` to the value,and `include_lower` to
`true`.
|`lt` |Same as setting `to` to the value, and `include_upper` to
`false`.
|`lte` |Same as setting `to` to the value, and `include_upper` to
`true`.
|`boost` |Sets the boost value of the query. Defaults to `1.0`.
|=======================================================================
deprecated[0.90.4,The `from`, `to`, `include_lower` and `include_upper` parameters have been deprecated in favour of `gt`,`gte`,`lt`,`lte`]