Interface SearchKeywords
public interface SearchKeywords
Search keywords are primarily used by the suggester but are also considered for the full-text search. SearchKeywords is a JSON object where the keys are of IETF language tag. The value to a language tag key is an array of SearchKeyword for the specific language.
{
"en": [
{ "text": "Multi tool" },
{ "text": "Swiss Army Knife", "suggestTokenizer": { "type": "whitespace" } }
],
"de": [
{
"text": "Schweizer Messer",
"suggestTokenizer": {
"type": "custom",
"inputs": ["schweizer messer", "offiziersmesser", "sackmesser"]
}
}
]
}
Example to create an instance using the builder pattern
SearchKeywords searchKeywords = SearchKeywords.builder()
.plus/^[a-z]{2}(-[A-Z]{2})?$/(/^[a-z]{2}(-[A-Z]{2})?$/Builder -> /^[a-z]{2}(-[A-Z]{2})?$/Builder)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic SearchKeywordsBuilder
builder()
builder factory method for SearchKeywordsstatic SearchKeywordsBuilder
builder
(SearchKeywords template) create builder for SearchKeywords instancestatic SearchKeywords
deepCopy
(SearchKeywords template) factory method to create a deep copy of SearchKeywordsstatic SearchKeywords
of()
factory methodstatic SearchKeywords
of
(SearchKeywords template) factory method to create a shallow copy SearchKeywordsvoid
setValue
(String key, List<SearchKeyword> value) set pattern propertystatic com.fasterxml.jackson.core.type.TypeReference<SearchKeywords>
gives a TypeReference for usage with Jackson DataBind@NotNull @Valid Map<String,
List<SearchKeyword>> values()
default <T> T
withSearchKeywords
(Function<SearchKeywords, T> helper) accessor map function
-
Method Details
-
values
- Returns:
- map of the pattern property values
-
setValue
set pattern property- Parameters:
key
- property namevalue
- property value
-
of
factory method- Returns:
- instance of SearchKeywords
-
of
factory method to create a shallow copy SearchKeywords- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of SearchKeywords- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for SearchKeywords- Returns:
- builder
-
builder
create builder for SearchKeywords instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withSearchKeywords
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
-