简体   繁体   English

如何使用 ElasticSearch 获得 0 到 1 之间的得分?

[英]How to obtain scoring between 0 and 1 with ElasticSearch?

Currently, I've indexed many documents in ElasticSearch and when I did a search on max score, the number exceeds 1.目前,我已经在 ElasticSearch 中索引了许多文档,当我对最大分数进行搜索时,数量超过了 1。

How can I obtain a similarity search, which is between 0 and 1 ?如何获得介于 0 和 1 之间的相似性搜索?

Should I configure ElasticSearch better ?我应该更好地配置 ElasticSearch 吗? or I should change my mapping?或者我应该改变我的映射?

Thanks in advance for your advices.预先感谢您的建议。

Lucene scoring is not classical cosinus-similarity function based on tif id vectors, but some modification wich takes into account other factors like boost on field or query terms. Lucene 评分不是基于 tif id 向量的经典余弦相似函数,而是进行了一些修改,其中考虑了其他因素,例如字段或查询词的提升。 You can read a mode details about scoring formula at page .您可以在页面阅读有关评分公式的模式详细信息。 So the simplest way to get scoring between a 0.0 and 1.0, just norm score on max_score from elasticsearch response (it coincides with score of the first document).因此,获得介于 0.0 和 1.0 之间的评分的最简单方法,只是从 elasticsearch 响应中对 max_score 的规范评分(它与第一个文档的评分一致)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM