"analysis": { -
"filter": { -
"my_pinyin": { -
"keep_joined_full_pinyin": "true",
"keep_separate_first_letter": "true",
"none_chinese_pinyin_tokenize": "true",
"type": "pinyin"
}
},
"analyzer": { -
"onlyOne_analyzer": { -
"tokenizer": "onlyOne_pinyin"
},
"ik_pinyin_analyzer": { -
"filter": [ -
"my_pinyin"
],
"type": "custom",
"tokenizer": "standard"
}
},
"tokenizer": { -
"onlyOne_pinyin": { -
"type": "pinyin",
"keep_separate_first_letter": "true",
"keep_full_pinyin": "false"
}
}
}
"filter": { -
"my_pinyin": { -
"keep_joined_full_pinyin": "true",
"keep_separate_first_letter": "true",
"none_chinese_pinyin_tokenize": "true",
"type": "pinyin"
}
},
"analyzer": { -
"onlyOne_analyzer": { -
"tokenizer": "onlyOne_pinyin"
},
"ik_pinyin_analyzer": { -
"filter": [ -
"my_pinyin"
],
"type": "custom",
"tokenizer": "standard"
}
},
"tokenizer": { -
"onlyOne_pinyin": { -
"type": "pinyin",
"keep_separate_first_letter": "true",
"keep_full_pinyin": "false"
}
}
}
3 个回复
FFFrp
赞同来自:
tulong - 80 IT
赞同来自:
zakokun - 后端开发
赞同来自:
如果你用的是onlyOne_pinyin 这个anazyler,那么分出来的就是 s,h,sh 那就肯定能查的到的.
如果用的是ik_pinyin_analyzer,那就搜索不到了,因为你把拼音放在filter,而经过standard这个tokenizer会吧上海-> 上, 海 两个单独的汉字,你自然就得不到 sh这样的缩写了