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();