seekExact

abstract fun seekExact(text: BytesRef): Boolean

Attempts to seek to the exact term, returning true if the term is found. If this returns false, the enum is unpositioned. For some codecs, seekExact may be substantially faster than .seekCeil.

Return

true if the term is found; return false if the enum is unpositioned.


abstract fun seekExact(ord: Long)

Seeks to the specified term by ordinal (position) as previously returned by .ord. The target ord may be before or after the current ord, and must be within bounds.


abstract fun seekExact(term: BytesRef, state: TermState)

Expert: Seeks a specific position by TermState previously obtained from .termState. Callers should maintain the TermState to use this method. Low-level implementations may position the TermsEnum without re-seeking the term dictionary.

Seeking by TermState should only be used iff the state was obtained from the same TermsEnum instance.

NOTE: Using this method with an incompatible TermState might leave this [ ] in undefined state. On a segment level TermState instances are compatible only iff the source and the target TermsEnum operate on the same field. If operating on segment level, TermState instances must not be used across segments.

NOTE: A seek by TermState might not restore the AttributeSource's state. AttributeSource states must be maintained separately if this method is used.

Parameters

term

the term the TermState corresponds to

state