Range query #
Returns documents that contain terms within a provided range.
Examples #
The following search returns documents where the age
field contains a term
between 10
and 20
.
GET /_search
{
"query": {
"range": {
"age": {
"gte": 10,
"lte": 20
}
}
}
}
Top-level parameters for range
#
<field>
(Required, object) Field you wish to search.
Parameters for <field>
#
gt
(Optional) Greater than.gte
(Optional) Greater than or equal to.lt
(Optional) Less than.lte
(Optional) Less than or equal to.