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

Ids Query

More info about ids query is in the official elasticsearch docs

Filters documents that only have the provided ids.

Simple example

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

In DSL:

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

$search = new Search();
$search->addQuery($idsQuery);

$queryArray = $search->toArray();