From 6a6f71b36a96c7eb228ca6764055ea2ea7c4b98d Mon Sep 17 00:00:00 2001 From: medcl Date: Tue, 24 Jan 2017 21:26:05 +0800 Subject: [PATCH] update doc for phrase query --- README.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1983b57..07f7c0d 100644 --- a/README.md +++ b/README.md @@ -230,4 +230,37 @@ curl -XGET http://localhost:9200/medcl1/_analyze?text=%e5%88%98%e5%be%b7%e5%8d%8 -7.That's all, have fun. +7.Used in phrase query +
+PUT /medcl/
+{
+    "index" : {
+        "analysis" : {
+            "analyzer" : {
+                "pinyin_analyzer" : {
+                    "tokenizer" : "my_pinyin"
+                    }
+            },
+            "tokenizer" : {
+                "my_pinyin" : {
+                    "type" : "pinyin",
+                    "keep_first_letter":false,
+                    "keep_separate_first_letter" : false,
+                    "keep_full_pinyin" : true,
+                    "keep_original" : false,
+                    "limit_first_letter_length" : 16,
+                    "lowercase" : true
+                }
+            }
+        }
+    }
+}
+GET /medcl/folks/_search
+{
+  "query": {"match_phrase": {
+    "name.pinyin": "刘德华"
+  }}
+}
+
+ +8.That's all, have fun.