ScorerSupplier

abstract class ScorerSupplier

A supplier of Scorer. This allows to get an estimate of the cost before building the Scorer.

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open 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
abstract fun get(leadCost: Long): Scorer?

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

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.