Browse Source

Add note about using ipv6 addresses in `query_string`.

Adrien Grand 9 years ago
parent
commit
80dbe31d59
1 changed files with 17 additions and 0 deletions
  1. 17 0
      docs/reference/mapping/types/ip.asciidoc

+ 17 - 0
docs/reference/mapping/types/ip.asciidoc

@@ -108,3 +108,20 @@ GET my_index/_search
   }
 }
 --------------------------------------------------
+
+Also beware that colons are special characters to the
+<<query-dsl-query-string-query,`query_string`>> query, so ipv6 addresses will
+need to be escaped. The easiest way to do so is to put quotes around the
+searched value:
+
+[source,js]
+--------------------------------------------------
+GET t/_search
+{
+  "query": {
+    "query_string" : {
+      "query": "ip_addr:\"2001:db8::/48\""
+    }
+  }
+}
+--------------------------------------------------