Interface SearchFuzzyValue

All Superinterfaces:
SearchQueryExpressionValue

public interface SearchFuzzyValue extends SearchQueryExpressionValue
SearchFuzzyValue
Example to create an instance using the builder pattern

     SearchFuzzyValue searchFuzzyValue = SearchFuzzyValue.builder()
             .field("{field}")
             .level(0.3)
             .build()
 
  • Method Details

    • getValue

      @NotNull @NotNull Object getValue()

      The search term to find fuzzy matches for. If multiple terms are provided (separated by whitespace), the fuzziness level is applied to each term individually.

      Returns:
      value
    • getLevel

      @NotNull @NotNull Integer getLevel()

      The maximum fuzziness level desired for the search term. Allowed values are 0, 1, and 2. The API automatically adjusts the effective fuzziness level based on the length of the search term if it exceeds the maximum allowed for the given string length according to the following rules:

      • Terms with 1-2 characters: 0 (exact match)
      • Terms with 3-5 characters: 1 (up to one difference is allowed)
      • Terms with more than 5 characters: 2 (up to two differences are allowed)
      Returns:
      level
    • getLanguage

      String getLanguage()

      Language of the localized value. Must be provided when the field is of type localizedTextField. The provided Locale must be one of the Project's languages.

      Returns:
      language
    • getMustMatch

      SearchMatchType getMustMatch()

      Controls whether all of the provided terms must match (all, default) or any of those (any).

      Returns:
      mustMatch
    • setValue

      void setValue(Object value)

      The search term to find fuzzy matches for. If multiple terms are provided (separated by whitespace), the fuzziness level is applied to each term individually.

      Parameters:
      value - value to be set
    • setLevel

      void setLevel(Integer level)

      The maximum fuzziness level desired for the search term. Allowed values are 0, 1, and 2. The API automatically adjusts the effective fuzziness level based on the length of the search term if it exceeds the maximum allowed for the given string length according to the following rules:

      • Terms with 1-2 characters: 0 (exact match)
      • Terms with 3-5 characters: 1 (up to one difference is allowed)
      • Terms with more than 5 characters: 2 (up to two differences are allowed)
      Parameters:
      level - value to be set
    • setLanguage

      void setLanguage(String language)

      Language of the localized value. Must be provided when the field is of type localizedTextField. The provided Locale must be one of the Project's languages.

      Parameters:
      language - value to be set
    • setMustMatch

      void setMustMatch(SearchMatchType mustMatch)

      Controls whether all of the provided terms must match (all, default) or any of those (any).

      Parameters:
      mustMatch - value to be set
    • of

      static SearchFuzzyValue of()
      factory method
      Returns:
      instance of SearchFuzzyValue
    • of

      static SearchFuzzyValue of(SearchFuzzyValue template)
      factory method to create a shallow copy SearchFuzzyValue
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      SearchFuzzyValue copyDeep()
      Specified by:
      copyDeep in interface SearchQueryExpressionValue
    • deepCopy

      @Nullable static SearchFuzzyValue deepCopy(@Nullable SearchFuzzyValue template)
      factory method to create a deep copy of SearchFuzzyValue
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static SearchFuzzyValueBuilder builder()
      builder factory method for SearchFuzzyValue
      Returns:
      builder
    • builder

      static SearchFuzzyValueBuilder builder(SearchFuzzyValue template)
      create builder for SearchFuzzyValue instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withSearchFuzzyValue

      default <T> T withSearchFuzzyValue(Function<SearchFuzzyValue,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<SearchFuzzyValue> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference