Package org.apache.lucene.search
Class ConstantScoreScorerSupplier
java.lang.Object
org.apache.lucene.search.ScorerSupplier
org.apache.lucene.search.ConstantScoreScorerSupplier
Specialization of
ScorerSupplier for queries that produce constant scores.- NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstantScoreScorerSupplier(float score, ScoreMode scoreMode, int maxDoc) Constructor, invoked by sub-classes. -
Method Summary
Modifier and TypeMethodDescriptionfinal BulkScorerOptional method: Get a scorer that is optimized for bulk-scoring.static ConstantScoreScorerSupplierfromIterator(DocIdSetIterator iterator, float score, ScoreMode scoreMode, int maxDoc) Create aConstantScoreScorerSupplierfor the given iterator.final Scorerget(long leadCost) Get theScorer.abstract DocIdSetIteratoriterator(long leadCost) Return an iterator given the cost of the leading clause.static ConstantScoreScorerSupplierCreate aConstantScoreScorerSupplierthat matches all docs in [0, maxDoc).Methods inherited from class org.apache.lucene.search.ScorerSupplier
cost, setTopLevelScoringClause
-
Constructor Details
-
ConstantScoreScorerSupplier
Constructor, invoked by sub-classes.
-
-
Method Details
-
matchAll
Create aConstantScoreScorerSupplierthat matches all docs in [0, maxDoc). -
fromIterator
public static ConstantScoreScorerSupplier fromIterator(DocIdSetIterator iterator, float score, ScoreMode scoreMode, int maxDoc) Create aConstantScoreScorerSupplierfor the given iterator. -
iterator
Return an iterator given the cost of the leading clause.- Throws:
IOException
-
get
Description copied from class:ScorerSupplierGet theScorer. This may not returnnulland must be called at most once.- Specified by:
getin classScorerSupplier- 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 aScorerthat has good iteration capabilities.- Throws:
IOException
-
bulkScorer
Description copied from class:ScorerSupplierOptional method: Get a scorer that is optimized for bulk-scoring. The default implementation iterates matches from theScorerbut some queries can have more efficient approaches for matching all hits.- Overrides:
bulkScorerin classScorerSupplier- Throws:
IOException
-