TermStates

Maintains a IndexReader view over IndexReader instances containing a single term. The TermStates doesn't track if the given TermState objects are valid, neither if the TermState instances refer to the same terms in the associated readers.

Constructors

Link copied to clipboard
constructor(context: IndexReaderContext?)

Creates an empty TermStates from a IndexReaderContext

constructor(context: IndexReaderContext, state: TermState, ord: Int, docFreq: Int, totalTermFreq: Long)

Creates a TermStates with an initial TermState, IndexReader pair.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun accumulateStatistics(docFreq: Int, totalTermFreq: Long)

Expert: Accumulate term statistics.

Link copied to clipboard
fun clear()

Clears the TermStates internal state and removes all registered TermStates

Link copied to clipboard
fun docFreq(): Int

Returns the accumulated document frequency of all TermState instances passed to .register.

Link copied to clipboard

Returns a Supplier for a TermState for the given LeafReaderContext. This may return null if some cheap checks help figure out that this term doesn't exist in this leaf. The Supplier may then also return null if the term doesn't exist.

Link copied to clipboard
fun register(state: TermState, ord: Int)

Expert: Registers and associates a TermState with an leaf ordinal. The leaf ordinal should be derived from a IndexReaderContext's leaf ord. On the contrary to .register this method does NOT update term statistics.

fun register(state: TermState, ord: Int, docFreq: Int, totalTermFreq: Long)

Registers and associates a TermState with an leaf ordinal. The leaf ordinal should be derived from a IndexReaderContext's leaf ord.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Returns the accumulated term frequency of all TermState instances passed to .register.

Link copied to clipboard

Expert: Return whether this TermStates was built for the given [ ]. This is typically used for assertions.