使用 nohup 或 disown 如果你要让某个进程运行在后台。

match结果顺序问题

Elasticsearch | 作者 WarRomeo | 发布于2018年02月04日 | 阅读数:2727

大家好,使用match查询,搜索结果排序问题,请教一下。
文档中有:中国银行,中国建设银行,中国建设银行
执行搜索:
GET /_search
{
"query" : {
"match" : { "name" : "中国银行" }
}
}
搜索结果:
{
"took": 29,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 3,
"max_score": 1.258609,
"hits": [
{
"_index": "bank",
"_type": "docs",
"_id": "3",
"_score": 1.258609,
"_source": {
"name": "中国建设银行德胜门支行"
}
},
{
"_index": "bank",
"_type": "docs",
"_id": "2",
"_score": 1.1507283,
"_source": {
"name": "中国建设银行"
}
},
{
"_index": "bank",
"_type": "docs",
"_id": "1",
"_score": 1.1507283,
"_source": {
"name": "中国银行"
}
}
]
}
}
为什么“中国银行”和“中国建设银行”的分数相同,却比“中国建设银行德胜门支行”的分数低呢?
我想达到的效果是,如果文档中有和搜索的关键字完全匹配的记录,那么这条记录将在第一条显示,该如何实现呢?
已邀请:

laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net

赞同来自:

用match_pharse试试

要回复问题请先登录注册