我设置拼音分词的index和mapping后刘德华的分词结果是liu,liudehua,ldh,de,hua,且已经加好权重
{
"query": {
"query_string": {
"fields": [
"name.pinyin^60",
"alias.pinyin^40",
"name_py.pinyin^60"
],
"query": "*lx*",
"use_dis_max": false,
"default_operator": "OR"
}
}
}
搜索结果是 :"杨丽晓","户田惠梨香","李肖宁"他们权重相同,我想要顺序是:"李肖宁","杨丽晓","户田惠梨香",也就是关键字lx在name中出现的先后顺序排序,请教下各位大神怎么做?感谢
{
"query": {
"query_string": {
"fields": [
"name.pinyin^60",
"alias.pinyin^40",
"name_py.pinyin^60"
],
"query": "*lx*",
"use_dis_max": false,
"default_operator": "OR"
}
}
}
搜索结果是 :"杨丽晓","户田惠梨香","李肖宁"他们权重相同,我想要顺序是:"李肖宁","杨丽晓","户田惠梨香",也就是关键字lx在name中出现的先后顺序排序,请教下各位大神怎么做?感谢
4 个回复
wokeyi
赞同来自:
jlhde123
赞同来自:
es_zoom
赞同来自:
qijc
赞同来自: