标签:
我选择了elasticsearch-analysis-lc-pinyin作为拼音分词插件,它是一款elasticsearch拼音分词插件,可以支持按照全拼、首字母,中文混合搜索。
cd F:\software\elasticsearch-analysis-lc-pinyin-dev_2.2.2\elasticsearch-analysis-lc-pinyin
mvn package
curl -XPUT http://localhost:9200/addr curl -XPOST http://localhost:9200/addr/std/_mapping -d‘ { "std": { "properties": { "detail_name": { "type": "string", "analyzer": "lc_index", "search_analyzer": "lc_search", "fields": { "cn": { "type": "string", "analyzer": "ik_max_word", "search_analyzer": "ik_max_word" } } }, "door_name":{ "type": "string", "analyzer": "lc_index", "search_analyzer": "lc_search", "fields": { "cn": { "type": "string", "analyzer": "ik_max_word", "search_analyzer": "ik_max_word" } } } } } }‘
主要问题是在于,1.x是 index_analyzer 为 lc_index ,但是2.x 没有了index_analyzer 这个参数。
Elasticsearch 2.3.x 拼音分词 analysis-lc-pinyin
标签:
原文地址:http://www.cnblogs.com/churao/p/5884442.html