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

Query Filter

More info about query filter is in the official elasticsearch docs

Wraps any query to be used as a filter.

Simple example

{
    "filter" : {
        "query" : {
            "query_string" : {
                "query" : "this AND that OR thus"
            }
        }
    }
}

And now the query via DSL:

$queryStringQuery = new QueryStringQuery('this AND that OR thus');
$queryFilter = new QueryFilter($queryStringQuery);

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

$queryArray = $search->toArray();