ConstantScoreScorerSupplier

Specialization of ScorerSupplier for queries that produce constant scores.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun bulkScorer(): BulkScorer

Optional method: Get a scorer that is optimized for bulk-scoring. The default implementation iterates matches from the Scorer but some queries can have more efficient approaches for matching all hits.

Link copied to clipboard
abstract fun cost(): Long

Get an estimate of the Scorer that would be returned by .get. This may be a costly operation, so it should only be called if necessary.

Link copied to clipboard
open override fun get(leadCost: Long): Scorer

Get the Scorer. This may not return null and must be called at most once.

Link copied to clipboard
abstract fun iterator(leadCost: Long): DocIdSetIterator

Return an iterator given the cost of the leading clause.

Link copied to clipboard

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 Scorer.setMinCompetitiveScore calls.