From 275e51002079919b1d9fcc4bd2ad6ab44eda6a5f Mon Sep 17 00:00:00 2001 From: Aivaras Gotovskis <aivaras.gotovskis@ongr.io> Date: Thu, 2 Jul 2015 13:03:47 +0300 Subject: [PATCH] Add ids query doc. --- docs/Query/Ids.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 docs/Query/Ids.md diff --git a/docs/Query/Ids.md b/docs/Query/Ids.md new file mode 100644 index 0000000..bd22ead --- /dev/null +++ b/docs/Query/Ids.md @@ -0,0 +1,29 @@ +# Ids Query + +> More info about ids query is in the [official elasticsearch docs][1] + +Filters documents that only have the provided ids. + +## Simple example + +```JSON +{ + "ids" : { + "type" : "my_type", + "values" : ["1", "4", "100"] + } +} +``` + +In DSL: + +```php +$idsQuery = new IdsQuery(['1', '4', '100'], ['type' => 'my_type']); + +$search = new Search(); +$search->addQuery($idsQuery); + +$queryArray = $search->toArray(); +``` + +[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-ids-query.html -- GitLab