Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8177

BlockMaxConjunctionScorer should compute better lower bounds of the required scores

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • New

    Description

      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:

      // 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)
      

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jpountz Adrien Grand
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: