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

Terms Filter

More info about terms filter is in the official elasticsearch docs

Filters documents that have fields that match any of the provided terms.

Simple example

{
    "filter" : {
       "terms" : { "user" : ["kimchy", "elasticsearch"]}
    }
}

And now the query via DSL:

$termsFilter = new TermsFilter('user', ['kimchy', 'elasticsearch']);

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

$queryArray = $search->toArray();