Class MaxScoreSumPropagator


  • final class MaxScoreSumPropagator
    extends java.lang.Object
    Utility class to propagate scoring information in BooleanQuery, which compute the score as the sum of the scores of its matching clauses. This helps propagate information about the maximum produced score
    • Field Detail

      • numClauses

        private final int numClauses
      • scorers

        private final Scorer[] scorers
      • sumOfOtherMaxScores

        private final double[] sumOfOtherMaxScores
    • Constructor Detail

      • MaxScoreSumPropagator

        MaxScoreSumPropagator​(java.util.Collection<? extends Scorer> scorerList)
                       throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • computeSumOfComplement

        private static double[] computeSumOfComplement​(float[] v)
        Return an array which, at index i, stores the sum of all entries of v except the one at index i.
      • advanceShallow

        void advanceShallow​(int target)
                     throws java.io.IOException
        Throws:
        java.io.IOException
      • getMaxScore

        float getMaxScore​(int upTo)
                   throws java.io.IOException
        Throws:
        java.io.IOException
      • setMinCompetitiveScore

        void setMinCompetitiveScore​(float minScore)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • getMinCompetitiveScore

        private float getMinCompetitiveScore​(float minScoreSum,
                                             double sumOfOtherMaxScores)
        Return the minimum score that a Scorer must produce in order for a hit to be competitive.
      • scoreSumUpperBound

        private float scoreSumUpperBound​(double sum)