查询语句如下,有三个查询字段(corp_name、former_name、stockname),现有的打分策略是把三个匹配字段的得分结果相加,比如搜索"北京"时,如果一个doc中三个字段都包含北京,则最终该doc的得分是三个分值相加,有没有办法实现doc得分取三个字段中最高的得分{
"sort": [
{
"_score": {
"order": "desc"
}
}
],
"from": "0",
"size": "15"
"query": {
"bool": {
"must": [
{
"multi_match": {
"fields": [
"corp_name",
"former_name",
"stockname"
],
"operator": "and",
"query": "北京",
"type": "phrase",
"slop": 20
}
}
]
}
},
}
"sort": [
{
"_score": {
"order": "desc"
}
}
],
"from": "0",
"size": "15"
"query": {
"bool": {
"must": [
{
"multi_match": {
"fields": [
"corp_name",
"former_name",
"stockname"
],
"operator": "and",
"query": "北京",
"type": "phrase",
"slop": 20
}
}
]
}
},
}
3 个回复
elisha - 80后 IT
赞同来自:
rockybean - Elastic Certified Engineer, ElasticStack Fans,公众号:ElasticTalk
赞同来自:
https://www.elastic.co/guide/e ... .html
chennanfei - 吹风
赞同来自: