Class FuzzyOptions.Builder
- java.lang.Object
-
- org.elasticsearch.search.suggest.completion.FuzzyOptions.Builder
-
- Enclosing class:
- FuzzyOptions
public static class FuzzyOptions.Builder extends java.lang.Object
Options for fuzzy queries
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
Modifier and Type Method Description FuzzyOptions
build()
FuzzyOptions.Builder
setFuzziness(int editDistance)
Sets the level of fuzziness used to create suggestions using aFuzziness
instance.FuzzyOptions.Builder
setFuzziness(Fuzziness fuzziness)
Sets the level of fuzziness used to create suggestions using aFuzziness
instance.FuzzyOptions.Builder
setFuzzyMinLength(int fuzzyMinLength)
Sets the minimum length of input string before fuzzy suggestions are returned, defaulting to 3.FuzzyOptions.Builder
setFuzzyPrefixLength(int fuzzyPrefixLength)
Sets the minimum length of the input, which is not checked for fuzzy alternatives, defaults to 1FuzzyOptions.Builder
setMaxDeterminizedStates(int maxDeterminizedStates)
Sets the maximum automaton states allowed for the fuzzy expansionFuzzyOptions.Builder
setTranspositions(boolean transpositions)
Sets if transpositions (swapping one character for another) counts as one character change or two.FuzzyOptions.Builder
setUnicodeAware(boolean unicodeAware)
Set to true if all measurements (like edit distance, transpositions and lengths) are in unicode code points (actual letters) instead of bytes.
-
-
-
Method Detail
-
setFuzziness
public FuzzyOptions.Builder setFuzziness(int editDistance)
Sets the level of fuzziness used to create suggestions using aFuzziness
instance. The default value isFuzziness.ONE
which allows for an "edit distance" of one.
-
setFuzziness
public FuzzyOptions.Builder setFuzziness(Fuzziness fuzziness)
Sets the level of fuzziness used to create suggestions using aFuzziness
instance. The default value isFuzziness.ONE
which allows for an "edit distance" of one.
-
setTranspositions
public FuzzyOptions.Builder setTranspositions(boolean transpositions)
Sets if transpositions (swapping one character for another) counts as one character change or two. Defaults to true, meaning it uses the fuzzier option of counting transpositions as a single change.
-
setFuzzyMinLength
public FuzzyOptions.Builder setFuzzyMinLength(int fuzzyMinLength)
Sets the minimum length of input string before fuzzy suggestions are returned, defaulting to 3.
-
setFuzzyPrefixLength
public FuzzyOptions.Builder setFuzzyPrefixLength(int fuzzyPrefixLength)
Sets the minimum length of the input, which is not checked for fuzzy alternatives, defaults to 1
-
setMaxDeterminizedStates
public FuzzyOptions.Builder setMaxDeterminizedStates(int maxDeterminizedStates)
Sets the maximum automaton states allowed for the fuzzy expansion
-
setUnicodeAware
public FuzzyOptions.Builder setUnicodeAware(boolean unicodeAware)
Set to true if all measurements (like edit distance, transpositions and lengths) are in unicode code points (actual letters) instead of bytes. Default is false.
-
build
public FuzzyOptions build()
-
-