Elasticsearch仿百度搜索
一. 自定义Analyzer
PUT news
{
"settings": {
"analysis": {
"analyzer": {
"hanlp_standard_pinyin":{
"type": "custom",
"tokenizer": "hanlp_standard",
"filter": ["my_pinyin"]
}
},
"filter": {
"my_pinyin": {
"type" : "pinyin",
"keep_separate_first_letter" : false,
"keep_full_pinyin" : true,
"keep_original" : true,
"limit_first_letter_length" : 16,
"lowercase" : true,
"remove_duplicated_term" : true
}
}
}
}
}
相关文章