问题描述
我有一个具有多重标准的搜索。
I have a search which has multiple criterion.
每个标准(按分组应该
)具有不同的加权分数。
Each criterion (grouped by should
) has a different weighted score.
ElasticSearch返回结果列表;每个都有一个分数 - 这对我来说似乎是一个任意的得分。这是因为我找不到该分数的分母。
ElasticSearch returns a list of results; each with a score - which seems an arbitrary score to me. This is because I can't find a denominator for that score.
我的问题是 - 我如何将每个分数代表比例?
My question is - how can I represent each score as a ratio?
将每个分数除以 max_score
将无法正常工作,因为它将显示与100%匹配的最佳匹配搜索条件。
Dividing each score by max_score
would not work since it'll show the best match as a 100% match with the search criteria.
推荐答案
_score
计算取决于使用查询例如,一个简单的查询,如:
The _score
calculation depends on the combination of queries used. For instance, a simple query like:
{ "match": { "title": "search" }}
将使用Lucene的来实现自己的评分算法。
Without understanding what you want your query to do it is impossible to answer this. Depending on your use case, you could use the function_score
query to implement your own scoring algorithm.
这篇关于ElasticSearch得分的分母是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!