Elastic Search: Percentage Score

Is it possible to make a request for Elastic Search, which returns a percentage of the maximum score? Until now, it returns a value like "_score": 0.00786336, as well as a maximum rating, for example max_score": 0.13435546 , so I could try to convert the result , but I want the result to be already in percent, so I could use a minimum score, for example, 40 percent.

In short: is there a way to get _score as a percentage of the maximum score, or is there another way to set the minimum score? (seems complicated because max_score seems random)

+5
source share
2 answers

max_score not random, it is just the max all the result set results from your query.

The value of max_score is the highest _score any document matching our query.

For example, if your values ​​are _score : [0.00786336, 0.0123, 0.0813523, 0.13435546] , then your max_score is 0.13435546 .

There is also no limit on how high _score can be based on the relevance of your matches (i.e. it can exceed 1 )

If you try to imagine a “percent match” using the _score ratio from hit to max_score , you will get false results, especially if you have a lot of low hit points with little relevance, but max_score is close to those low points.

If you are trying to filter out the minimum score, you should use min_score

Also see "What is relevance?

0
source

One way to do this could be to save the hashes of the requests and min_score (calculated as a percentage of the maximum score). For example, if max_score is 1.1, min_score may be 0.44 for this query, which may help cut off irrelevant results.

0
source

Source: https://habr.com/ru/post/1232034/


All Articles