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 Details

    • values

      @NotNull @Valid @NotNull @Valid Map<String,List<SearchKeyword>> values()
      Returns:
      map of the pattern property values
    • setValue

      void setValue(String key, List<SearchKeyword> value)
      set pattern property
      Parameters:
      key - property name
      value - property value
    • of

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

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

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

      static SearchKeywordsBuilder builder()
      builder factory method for SearchKeywords
      Returns:
      builder
    • builder

      static SearchKeywordsBuilder builder(SearchKeywords template)
      create builder for SearchKeywords instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withSearchKeywords

      default <T> T withSearchKeywords(Function<SearchKeywords,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<SearchKeywords> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference