Class DisjunctionScoreBlockBoundaryPropagator


  • final class DisjunctionScoreBlockBoundaryPropagator
    extends java.lang.Object
    A helper to propagate block boundaries for disjunctions. Because a disjunction matches if any of its sub clauses matches, it is tempting to return the minimum block boundary across all clauses. The problem is that it might then make the query slow when the minimum competitive score is high and low-scoring clauses don't drive iteration anymore. So this class computes block boundaries only across clauses whose maximum score is greater than or equal to the minimum competitive score, or the maximum scoring clause if there is no such clause.
    • Field Detail

      • MAX_SCORE_COMPARATOR

        private static final java.util.Comparator<Scorer> MAX_SCORE_COMPARATOR
      • scorers

        private final Scorer[] scorers
      • maxScores

        private final float[] maxScores
      • leadIndex

        private int leadIndex
    • Constructor Detail

      • DisjunctionScoreBlockBoundaryPropagator

        DisjunctionScoreBlockBoundaryPropagator​(java.util.Collection<Scorer> scorers)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • advanceShallow

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

        void setMinCompetitiveScore​(float minScore)
                             throws java.io.IOException
        Set the minimum competitive score to filter out clauses that score less than this threshold.
        Throws:
        java.io.IOException
        See Also:
        Scorable.setMinCompetitiveScore(float)