FuzzyTermsEnum

Subclass of TermsEnum for enumerating all terms that are similar to the specified filter term.

Term enumerations are always ordered by BytesRef.compareTo. Each term in the enumeration is greater than all that precede it.

Constructors

Link copied to clipboard
constructor(terms: Terms, term: Term, maxEdits: Int, prefixLength: Int, transpositions: Boolean)

Constructor for enumeration of all terms from specified reader which share a prefix of length prefixLength with term and which have at most maxEdits edits.

Types

Link copied to clipboard

Thrown to indicate that there was an issue creating a fuzzy query for a given term. Typically occurs with terms longer than 220 UTF-8 characters, but also possible with shorter terms consisting of UTF-32 code points.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun attributes(): AttributeSource

Returns the related attributes.

Link copied to clipboard
open override fun docFreq(): Int

Returns the number of documents containing the current term. Do not call this when the enum is unpositioned. SeekStatus.END.

Link copied to clipboard
open override fun impacts(flags: Int): ImpactsEnum

Return a ImpactsEnum.

Link copied to clipboard
open override fun next(): BytesRef?

Increments the iteration to the next BytesRef in the iterator. Returns the resulting BytesRef or null if the end of the iterator is reached. The returned BytesRef may be re-used across calls to next. After this method returns null, do not call it again: the results are undefined.

Link copied to clipboard
open override fun ord(): Long

Returns ordinal position for current term. This is an optional method (the codec may throw UnsupportedOperationException). Do not call this when the enum is unpositioned.

Link copied to clipboard

Get PostingsEnum for the current term. Do not call this when the enum is unpositioned. This method will not return null.

open override fun postings(reuse: PostingsEnum?, flags: Int): PostingsEnum

Get PostingsEnum for the current term, with control over whether freqs, positions, offsets or payloads are required. Do not call this when the enum is unpositioned. This method will not return null.

Link copied to clipboard
open override fun prepareSeekExact(text: BytesRef): IOBooleanSupplier

Two-phase .seekExact. The first phase typically calls IndexInput.prefetch on the right range of bytes under the hood, while the second phase IOBooleanSupplier.get actually seeks the term within these bytes. This can be used to parallelize I/O across multiple terms by calling .prepareSeekExact on multiple terms enums before calling .

Link copied to clipboard
open override fun seekCeil(text: BytesRef): TermsEnum.SeekStatus

Seeks to the specified term, if it exists, or to the next (ceiling) term. Returns SeekStatus to indicate whether exact term was found, a different term was found, or EOF was hit. The target term may be before or after the current term. If this returns SeekStatus.END, the enum is unpositioned.

Link copied to clipboard
open override 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.

open override 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.

open override 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.

Link copied to clipboard

Sets the maximum non-competitive boost, which may allow switching to a lower max-edit automaton at run time

Link copied to clipboard
open override fun term(): BytesRef

Returns current term. Do not call this when the enum is unpositioned.

Link copied to clipboard
open override fun termState(): TermState

Expert: Returns the TermsEnums internal state to position the TermsEnum without re-seeking the term dictionary.

Link copied to clipboard
open override fun totalTermFreq(): Long

Returns the total number of occurrences of this term across all documents (the sum of the freq() for each doc that has this term). Note that, like other term measures, this measure does not take deleted documents into account.