Package org.apache.lucene.search
Class ScorerSupplier
- java.lang.Object
-
- org.apache.lucene.search.ScorerSupplier
-
public abstract class ScorerSupplier extends Object
-
-
Constructor Summary
Constructors Constructor Description ScorerSupplier()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract long
cost()
abstract Scorer
get(long leadCost)
Get theScorer
.void
setTopLevelScoringClause()
Inform thisScorerSupplier
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.
-
-
-
Method Detail
-
get
public abstract Scorer get(long leadCost) throws IOException
Get theScorer
. This may not returnnull
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 thatDocIdSetIterator.nextDoc()
,DocIdSetIterator.advance(int)
andTwoPhaseIterator.matches()
will be called. Under doubt, passLong.MAX_VALUE
, which will produce aScorer
that has good iteration capabilities.- Throws:
IOException
-
cost
public abstract long cost()
Get an estimate of theScorer
that would be returned byget(long)
. This may be a costly operation, so it should only be called if necessary.- See Also:
DocIdSetIterator.cost()
-
setTopLevelScoringClause
public void setTopLevelScoringClause() throws IOException
Inform thisScorerSupplier
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 isScoreMode.COMPLETE_NO_SCORES
, so implementations should look at both the score mode and this boolean to know whether to prepare for reacting toScorable.setMinCompetitiveScore(float)
calls.- Throws:
IOException
-
-