elasticsearch-analysis-pinyin 1.7.4 版本怎么提取首字母?好像只是提供了转化为拼音的功能。(线上跑的2.3.4版本的es,升级怕丢失数据)
附索引设置:
{
"settings":{
"analysis":{
"analyzer":{
"pinyin_analyzer":{
"tokenizer":"my_pinyin"
}
},
"tokenizer":{
"my_pinyin":{
"type":"pinyin",
"keep_separate_first_letter":true,
"keep_full_pinyin":true,
"keep_original":true,
"limit_first_letter_length":16,
"lowercase":true
}
}
}
},
"mappings":{
"user":{
"properties":{
"title":{
"type":"string",
"analyzer":"ik_max_word"
},
"user_pinyin_title":{
"type":"string",
"store":"yes",
"term_vector":"with_offsets",
"analyzer":"pinyin_analyzer"
},
"biography":{
"type":"string",
"analyzer":"ik_max_word"
}
}
}
}
}
附索引设置:
{
"settings":{
"analysis":{
"analyzer":{
"pinyin_analyzer":{
"tokenizer":"my_pinyin"
}
},
"tokenizer":{
"my_pinyin":{
"type":"pinyin",
"keep_separate_first_letter":true,
"keep_full_pinyin":true,
"keep_original":true,
"limit_first_letter_length":16,
"lowercase":true
}
}
}
},
"mappings":{
"user":{
"properties":{
"title":{
"type":"string",
"analyzer":"ik_max_word"
},
"user_pinyin_title":{
"type":"string",
"store":"yes",
"term_vector":"with_offsets",
"analyzer":"pinyin_analyzer"
},
"biography":{
"type":"string",
"analyzer":"ik_max_word"
}
}
}
}
}
1 个回复
medcl - 今晚打老虎。
赞同来自: