fuzzyTerm

fun fuzzyTerm(term: String, maxEdits: Int): IntervalsSource

A fuzzy term IntervalsSource matches the disjunction of intervals of terms that are within the specified maxEdits from the provided term.

Parameters

term

the term to search for

maxEdits

must be >= 0 and <= LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE, use FuzzyQuery.defaultMaxEdits for the default, if needed.

See also


fun fuzzyTerm(term: String, maxEdits: Int, prefixLength: Int, transpositions: Boolean, maxExpansions: Int): IntervalsSource

A fuzzy term IntervalsSource matches the disjunction of intervals of terms that are within the specified maxEdits from the provided term.

The implementation is delegated to a [multiterm] interval source, with an automaton sourced from [FuzzyQuery].

Parameters

term

the term to search for

maxEdits

must be >= 0 and <= LevenshteinAutomata.MAXIMUM_SUPPORTED_DISTANCE, use FuzzyQuery.defaultMaxEdits for the default, if needed.

prefixLength

length of common (non-fuzzy) prefix

maxExpansions

the maximum number of terms to match. Setting maxExpansions to higher than the default value of DEFAULT_MAX_EXPANSIONS can be both slow and memory-intensive

transpositions

true if transpositions should be treated as a primitive edit operation. If this is false, comparisons will implement the classic Levenshtein algorithm.