Class FuzzyOptions.Builder

  • Enclosing class:
    FuzzyOptions

    public static class FuzzyOptions.Builder
    extends java.lang.Object
    Options for fuzzy queries
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • setFuzziness

        public FuzzyOptions.Builder setFuzziness​(int editDistance)
        Sets the level of fuzziness used to create suggestions using a Fuzziness instance. The default value is Fuzziness.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.