Adrien Grand created LUCENE-8177:
------------------------------------

             Summary: BlockMaxConjunctionScorer should compute better lower 
bounds of the required scores
                 Key: LUCENE-8177
                 URL: https://issues.apache.org/jira/browse/LUCENE-8177
             Project: Lucene - Core
          Issue Type: Bug
            Reporter: Adrien Grand


Assuming N scorers, {{BlockMaxConjunctionScorer}} computes a lower bound of the 
sum of scores for scorers 0..i, for any given 0 <= i < N.

For instance say you are searching for "quick AND fox", that a hit needs a 
score of 4 to be competitive and that "quick" contributes at most 3 to the 
score and "fox" 2. This means that for a given hit to be competitive, the sum 
of scores must be at least 4-maxScore(fox)=4-2=2 after having scored "quick" 
and 4 after having scored "fox".

Currently we have this in BlockMaxConjunctionScorer:
{code:java}
// Also compute the minimum required scores for a hit to be competitive
// A double that is less than 'score' might still be converted to 'score'
// when casted to a float, so we go to the previous float to avoid this issue
minScores[minScores.length - 1] = minScore > 0 ? Math.nextDown(minScore)
{code}

We currently use {{Math.minDown(float)}} to be safe, but we would get a better 
bound by computing the lowest double that is converted to {{minScore}} when 
casted to a float.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to