Interface SearchFuzzyValue
- All Superinterfaces:
SearchQueryExpressionValue
Example to create an instance using the builder pattern
SearchFuzzyValue searchFuzzyValue = SearchFuzzyValue.builder()
.field("{field}")
.level(0.3)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic SearchFuzzyValueBuilderbuilder()builder factory method for SearchFuzzyValuestatic SearchFuzzyValueBuilderbuilder(SearchFuzzyValue template) create builder for SearchFuzzyValue instancecopyDeep()static SearchFuzzyValuedeepCopy(SearchFuzzyValue template) factory method to create a deep copy of SearchFuzzyValueLanguage of the localized value.@NotNull IntegergetLevel()The maximum fuzziness level desired for the search term.Controls whether all of the provided terms must match (all, default) or any of those (any).@NotNull ObjectgetValue()The search term to find fuzzy matches for.static SearchFuzzyValueof()factory methodstatic SearchFuzzyValueof(SearchFuzzyValue template) factory method to create a shallow copy SearchFuzzyValuevoidsetLanguage(String language) Language of the localized value.voidThe maximum fuzziness level desired for the search term.voidsetMustMatch(SearchMatchType mustMatch) Controls whether all of the provided terms must match (all, default) or any of those (any).voidThe search term to find fuzzy matches for.static com.fasterxml.jackson.core.type.TypeReference<SearchFuzzyValue>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithSearchFuzzyValue(Function<SearchFuzzyValue, T> helper) accessor map functionMethods inherited from interface com.commercetools.api.models.search.SearchQueryExpressionValue
getBoost, getField, getFieldType, setBoost, setField, setFieldType, withSearchQueryExpressionValue
-
Method Details
-
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
The maximum fuzziness level desired for the search term. Allowed values are
0,1, and2. 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
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
The maximum fuzziness level desired for the search term. Allowed values are
0,1, and2. 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
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
Controls whether all of the provided terms must match (
all, default) or any of those (any).- Parameters:
mustMatch- value to be set
-
of
factory method- Returns:
- instance of SearchFuzzyValue
-
of
factory method to create a shallow copy SearchFuzzyValue- Parameters:
template- instance to be copied- Returns:
- copy instance
-
copyDeep
SearchFuzzyValue copyDeep()- Specified by:
copyDeepin interfaceSearchQueryExpressionValue
-
deepCopy
factory method to create a deep copy of SearchFuzzyValue- Parameters:
template- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for SearchFuzzyValue- Returns:
- builder
-
builder
create builder for SearchFuzzyValue instance- Parameters:
template- instance with prefilled values for the builder- Returns:
- builder
-
withSearchFuzzyValue
accessor map function- Type Parameters:
T- mapped type- Parameters:
helper- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-