From 254dfa1d1158f66b655de8187c03368473e3494c Mon Sep 17 00:00:00 2001 From: Aivaras Gotovskis <aivaras.gotovskis@ongr.io> Date: Tue, 7 Jul 2015 17:36:47 +0300 Subject: [PATCH] Add ids filter doc. --- docs/Filter/Ids.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/Filter/Ids.md diff --git a/docs/Filter/Ids.md b/docs/Filter/Ids.md new file mode 100644 index 0000000..e2bcfb6 --- /dev/null +++ b/docs/Filter/Ids.md @@ -0,0 +1,32 @@ +# Ids Filter + +> More info about ids filter 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"] + } +} +``` + +And now the query via DSL: + +```php +$idsFilters = new IdsFilter( + ['1', '4', '100'], + ['type' => 'my_type'] +); + +$search = new Search(); +$search->addFilter($idsFilters); + +$queryArray = $search->toArray(); +``` + +[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-ids-filter.html -- GitLab