Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.

Range Filter

More info about range filter is in the official elasticsearch docs

Filters documents with fields that have terms within a certain range.

Simple example

{
    "filter" : {
        "range" : {
            "age" : {
                "gte": 10,
                "lte": 20
            }
        }
    }
}

And now the query via DSL:

$rangeFilter = new RangeFilter('age', ['gte' => 10, 'lte' => 20]);

$search = new Search();
$search->addFilter($rangeFilter);

$queryArray = $search->toArray();