summaryrefslogtreecommitdiff
path: root/docs/reference/query-dsl/queries/regexp-query.asciidoc
diff options
context:
space:
mode:
authorHilko Bengen <bengen@debian.org>2014-06-07 12:02:12 +0200
committerHilko Bengen <bengen@debian.org>2014-06-07 12:02:12 +0200
commitd5ed89b946297270ec28abf44bef2371a06f1f4f (patch)
treece2d945e4dde69af90bd9905a70d8d27f4936776 /docs/reference/query-dsl/queries/regexp-query.asciidoc
downloadelasticsearch-d5ed89b946297270ec28abf44bef2371a06f1f4f.tar.gz
Imported Upstream version 1.0.3upstream/1.0.3
Diffstat (limited to 'docs/reference/query-dsl/queries/regexp-query.asciidoc')
-rw-r--r--docs/reference/query-dsl/queries/regexp-query.asciidoc54
1 files changed, 54 insertions, 0 deletions
diff --git a/docs/reference/query-dsl/queries/regexp-query.asciidoc b/docs/reference/query-dsl/queries/regexp-query.asciidoc
new file mode 100644
index 0000000..3345773
--- /dev/null
+++ b/docs/reference/query-dsl/queries/regexp-query.asciidoc
@@ -0,0 +1,54 @@
+[[query-dsl-regexp-query]]
+=== Regexp Query
+
+The `regexp` query allows you to use regular expression term queries.
+See <<regexp-syntax>> for details of the supported regular expression language.
+
+*Note*: The performance of a `regexp` query heavily depends on the
+regular expression chosen. Matching everything like `.*` is very slow as
+well as using lookaround regular expressions. If possible, you should
+try to use a long prefix before your regular expression starts. Wildcard
+matchers like `.*?+` will mostly lower performance.
+
+[source,js]
+--------------------------------------------------
+{
+ "regexp":{
+ "name.first": "s.*y"
+ }
+}
+--------------------------------------------------
+
+Boosting is also supported
+
+[source,js]
+--------------------------------------------------
+{
+ "regexp":{
+ "name.first":{
+ "value":"s.*y",
+ "boost":1.2
+ }
+ }
+}
+--------------------------------------------------
+
+You can also use special flags
+
+[source,js]
+--------------------------------------------------
+{
+ "regexp":{
+ "name.first": "s.*y",
+ "flags" : "INTERSECTION|COMPLEMENT|EMPTY"
+ }
+}
+--------------------------------------------------
+
+Possible flags are `ALL`, `ANYSTRING`, `AUTOMATON`, `COMPLEMENT`,
+`EMPTY`, `INTERSECTION`, `INTERVAL`, or `NONE`. Please check the
+http://lucene.apache.org/core/4_3_0/core/index.html?org%2Fapache%2Flucene%2Futil%2Fautomaton%2FRegExp.html[Lucene
+documentation] for their meaning
+
+
+include::regexp-syntax.asciidoc[]