elasticsearch - 在 ElasticSearch 中返回高质量的结果
问题描述
我将搜索查询发送到我的 ES 索引并返回多个结果。很多时候,分数较低的结果是无关紧要的,我想删除这些结果并只返回高质量的结果(通常有更高的分数)。
我的索引包含 1000 个 100-500 字的文本类型文档。例如 -{"text":'AVENGERS: ENDGAME is set after Thanos' catastrophic use of the Infinity Stones randomly wiped out half of Earth's population in Avengers: Infinity War. Those left behind are desperate to do something -- anything -- to bring back their lost loved ones. But after an initial attempt -- with extra help from Captain Marvel -- creates more problems than solutions, the grieving, purposeless Avengers think all hope is lost.'}
如果用户搜索“Captain Marvel aka Brie Larson 在电影中杀死了灭霸”,则上述文档应作为结果返回,因为它包含类似的术语。
目前,我正在使用 min_score 来设置阈值,但我知道这不是最佳实践,并且分数取决于索引中的文档数量(将不断增长)。所以这种方法似乎不可扩展。
我还尝试了多种方法来调整查询以获取高质量的结果,例如 More Like This 功能
"must":
[{"more_like_this" : {
"fields" : field_list,
"like" : query_data,
"min_term_freq" : 1,
"max_query_terms" : 50,
"min_doc_freq" : 1,
"minimum_should_match" : '50%'}}]}}
但是我仍然得到像 1.5 这样的低分结果,而高质量的结果通常有 20 分。有没有更好的方法来进一步调整查询或将 min_score 调整为动态以仅返回高度相关的文档?任何帮助,将不胜感激!
解决方案
推荐阅读
- c++ - “Lambdas 很便宜”——真的吗?在什么情况下?
- linux - Telnet 到不在同一子网上的机器
- java - 扫描程序 java.util.NoSuchElementException
- forms - 在 Vue 中使用 Axios 发布到 Zapier Hook 会导致 CORS 错误
- c# - 未创建会话:此版本的 chromedriver 在运行测试期间仅支持hackerrank 上的 chrome 版本 81 (sessionnotcreated)
- python - 有没有办法解决数据库错误?
- java - 从部署在公共端口上的 Angular 应用程序访问部署在私有端口上的 Rest API(面向 Internet)
- python - 根据方法向 API 发送请求
- influxdb - InfluxDB 无 GROUP BY 时间的连续查询
- javascript - 是否可以仅将 css 应用于由扩展程序打开的窗口?