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

Ids Filter

More info about ids filter is in the official elasticsearch docs

Filters documents that only have the provided ids.

Simple example

{
    "ids" : {
        "type" : "my_type",
        "values" : ["1", "4", "100"]
    }
}

And now the query via DSL:

$idsFilters = new IdsFilter(
    ['1', '4', '100'],
    ['type' => 'my_type']
);

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

$queryArray = $search->toArray();