Range Query
More info about range query is in the official elasticsearch docs
Matches documents with fields that have terms within a certain range.
Simple example
{
{
"range" : {
"age" : {
"gte" : 10,
"lte" : 20,
"boost" : 2.0
}
}
}
}
In DSL:
$rangeQuery = new RangeQuery(
'age',
[
'gte' => 10,
'lte' => 20,
'boost' => 2.0,
]
);
$search = new Search();
$search->addQuery($rangeQuery);
$queryArray = $search->toArray();