From c3bab416759f03aa2730d0a2fa8952313b16a3f9 Mon Sep 17 00:00:00 2001
From: Aivaras Gotovskis <aivaras.gotovskis@ongr.io>
Date: Wed, 8 Jul 2015 10:06:22 +0300
Subject: [PATCH] Add regexp query doc.

---
 docs/Query/Regexp.md | 30 ++++++++++++++++++++++++++++++
 docs/Query/index.md  |  1 +
 2 files changed, 31 insertions(+)
 create mode 100644 docs/Query/Regexp.md

diff --git a/docs/Query/Regexp.md b/docs/Query/Regexp.md
new file mode 100644
index 0000000..d698b00
--- /dev/null
+++ b/docs/Query/Regexp.md
@@ -0,0 +1,30 @@
+# Regexp Query
+
+> More info about regexp query is in the [official elasticsearch docs][1]
+
+The regexp query allows you to use regular expression term queries.
+
+## Simple example
+
+```JSON
+{
+    "filter": {
+        "regexp":{
+            "name.first" : "s.*y"
+        }
+    }
+}
+```
+
+And now the query via DSL:
+
+```php
+$regexpQuery = new RegexpQuery('name.first', 's.*y');
+
+$search = new Search();
+$search->addQuery($regexpQuery);
+
+$queryArray = $search->toArray();
+```
+
+[1]: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-regexp-query.html
diff --git a/docs/Query/index.md b/docs/Query/index.md
index 0fcf40f..3345e50 100644
--- a/docs/Query/index.md
+++ b/docs/Query/index.md
@@ -49,6 +49,7 @@ For more information how to combine search queries take a look at [How to search
  - [Prefix](Prefix.md)
  - [Query string](QueryString.md)
  - [Range](Range.md)
+ - [Regexp](Regexp.md)
  - [Simple query string](SimpleQueryString.md)
  - [Term](Term.md)
  - [Terms](Terms.md)
-- 
GitLab