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

Regexp Filter

More info about regexp filter is in the official elasticsearch docs

The regexp filter allows you to use regular expression term queries. The regexp filter is similar to the regexp query, except that it is cacheable and can speedup performance in case you are reusing this filter in your queries.

Simple example

{
    "regexp":{
        "name.first": "s.*y"
    }
}

And now the query via DSL:

$regexpFilter = new RegexpFilter('name.first', 's.*y');

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

$queryArray = $search->toArray();