I am thinking about the default scoring function for which StandardAnalyzer has been used.
It seems the value is sometimes above 1.0.
There isn't really a maximum score.
When Lucene does it's scoring, it basically sums a set of scores together to give a total score.
For example:
Suppose I search for
A OR B
. This query is broken into its constituent parts -A
andB
. Each part of this query is searched independently using a sub-scorer and given score for the relevant part of the query. If a document contains bothA
andB
, the score will be a combination of scores from both sub-scorers.
Because there can be many sub-scorers, the total score can be greater than 1.
The score of a particular hit is absolute, meaning that it can only be used as a comparison to the highest score from the same search. Scores across different searches are not directly comparable.
If you really do need a value between 0 and 1, you can normalise each score based on the ratio of its value to the highest score from the search. This will give you the equivalent of a percentage score. These percentages still cannot be compared across searches though.
More info can be found here and here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With