Class ScorerSupplier

    • Constructor Detail

      • ScorerSupplier

        public ScorerSupplier()
    • Method Detail

      • get

        public abstract Scorer get​(long leadCost)
                            throws java.io.IOException
        Get the Scorer. This may not return null and must be called at most once.
        Parameters:
        leadCost - Cost of the scorer that will be used in order to lead iteration. This can be interpreted as an upper bound of the number of times that DocIdSetIterator.nextDoc(), DocIdSetIterator.advance(int) and TwoPhaseIterator.matches() will be called. Under doubt, pass Long.MAX_VALUE, which will produce a Scorer that has good iteration capabilities.
        Throws:
        java.io.IOException
      • cost

        public abstract long cost()
        Get an estimate of the Scorer that would be returned by get(long). This may be a costly operation, so it should only be called if necessary.
        See Also:
        DocIdSetIterator.cost()
      • setTopLevelScoringClause

        public void setTopLevelScoringClause()
                                      throws java.io.IOException
        Inform this ScorerSupplier that its returned scorers produce scores that get passed to the collector, as opposed to partial scores that then need to get combined (e.g. summed up). Note that this method also gets called if scores are not requested, e.g. because the score mode is ScoreMode.COMPLETE_NO_SCORES, so implementations should look at both the score mode and this boolean to know whether to prepare for reacting to Scorable.setMinCompetitiveScore(float) calls.
        Throws:
        java.io.IOException