From 2fa61b155cffc0269fbdeac4880f941a590b9278 Mon Sep 17 00:00:00 2001
From: Aivaras Gotovskis <aivaras.gotovskis@ongr.io>
Date: Wed, 8 Jul 2015 09:06:42 +0300
Subject: [PATCH] Add indices filter doc.

---
 docs/Filter/Indices.md | 45 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 docs/Filter/Indices.md

diff --git a/docs/Filter/Indices.md b/docs/Filter/Indices.md
new file mode 100644
index 0000000..caacb11
--- /dev/null
+++ b/docs/Filter/Indices.md
@@ -0,0 +1,45 @@
+# Indices Filter
+
+> More info about indices filter is in the [official elasticsearch docs][1]
+
+The indices filter can be used when executed across multiple indices,
+allowing to have a filter that executes only when executed on an index
+that matches a specific list of indices, and another filter that
+executes when it is executed on an index that does not match the listed
+indices.
+
+## Simple example
+
+```JSON
+{
+    "indices" : {
+        "indices" : ["index1", "index2"],
+        "filter" : {
+            "term" : { "tag" : "wow" }
+        },
+        "no_match_filter" : {
+            "term" : { "tag" : "kow" }
+        }
+    }
+}
+```
+
+And now the query via DSL:
+
+```php
+$termFilter1 = new TermFilter('tag', 'wow');
+$termFilter2 = new TermFilter('tag', 'kow');
+
+$indicesFilter = new IndicesFilter(
+    ['index1', 'index2'],
+    $termFilter1,
+    $termFilter2
+);
+
+$search = new Search();
+$search->addFilter($indicesFilter);
+
+$queryArray = $search->toArray();
+```
+
+[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-indices-filter.html
-- 
GitLab