ConstantScoreWeight

abstract class ConstantScoreWeight : Weight

A Weight that has a constant score equal to the boost of the wrapped query. This is typically useful when building queries which do not produce meaningful scores and are mostly useful for filtering.

Properties

Link copied to clipboard
open val query: Query

The query that this concerns.

Functions

Link copied to clipboard

Helper method that delegates to .scorerSupplier. It is implemented as

Link copied to clipboard
open fun count(context: LeafReaderContext): Int

Counts the number of live documents that match a given this.query in a leaf.

Link copied to clipboard
open override fun explain(context: LeafReaderContext, doc: Int): Explanation

An explanation of the score computation for the named document.

Link copied to clipboard
Link copied to clipboard
open fun matches(context: LeafReaderContext, doc: Int): Matches?

Returns Matches for a specific document, or null if the document does not match the parent query

Link copied to clipboard

Optional method that delegates to scorerSupplier.

Link copied to clipboard

Get a ScorerSupplier, which allows knowing the cost of the Scorer before building it. A scorer supplier for the same LeafReaderContext instance may be requested multiple times as part of a single search call.