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.