Class PhraseSuggester

java.lang.Object
co.elastic.clients.elasticsearch.core.search.SuggesterBase
co.elastic.clients.elasticsearch.core.search.PhraseSuggester
All Implemented Interfaces:
FieldSuggesterVariant, JsonpSerializable

@JsonpDeserializable public class PhraseSuggester extends SuggesterBase implements FieldSuggesterVariant
See Also:
  • Field Details

  • Method Details

    • of

    • _fieldSuggesterKind

      public FieldSuggester.Kind _fieldSuggesterKind()
      FieldSuggester variant kind.
      Specified by:
      _fieldSuggesterKind in interface FieldSuggesterVariant
    • collate

      @Nullable public final PhraseSuggestCollate collate()
      Checks each suggestion against the specified query to prune suggestions for which no matching docs exist in the index.

      API name: collate

    • confidence

      @Nullable public final Double confidence()
      Defines a factor applied to the input phrases score, which is used as a threshold for other suggest candidates. Only candidates that score higher than the threshold will be included in the result.

      API name: confidence

    • directGenerator

      public final List<DirectGenerator> directGenerator()
      A list of candidate generators that produce a list of possible terms per term in the given text.

      API name: direct_generator

    • forceUnigrams

      @Nullable public final Boolean forceUnigrams()
      API name: force_unigrams
    • gramSize

      @Nullable public final Integer gramSize()
      Sets max size of the n-grams (shingles) in the field. If the field doesn’t contain n-grams (shingles), this should be omitted or set to 1. If the field uses a shingle filter, the gram_size is set to the max_shingle_size if not explicitly set.

      API name: gram_size

    • highlight

      @Nullable public final PhraseSuggestHighlight highlight()
      Sets up suggestion highlighting. If not provided, no highlighted field is returned.

      API name: highlight

    • maxErrors

      @Nullable public final Double maxErrors()
      The maximum percentage of the terms considered to be misspellings in order to form a correction. This method accepts a float value in the range [0..1) as a fraction of the actual query terms or a number >=1 as an absolute number of query terms.

      API name: max_errors

    • realWordErrorLikelihood

      @Nullable public final Double realWordErrorLikelihood()
      The likelihood of a term being misspelled even if the term exists in the dictionary.

      API name: real_word_error_likelihood

    • separator

      @Nullable public final String separator()
      The separator that is used to separate terms in the bigram field. If not set, the whitespace character is used as a separator.

      API name: separator

    • shardSize

      @Nullable public final Integer shardSize()
      Sets the maximum number of suggested terms to be retrieved from each individual shard.

      API name: shard_size

    • smoothing

      @Nullable public final SmoothingModel smoothing()
      The smoothing model used to balance weight between infrequent grams (grams (shingles) are not existing in the index) and frequent grams (appear at least once in the index). The default model is Stupid Backoff.

      API name: smoothing

    • text

      @Nullable public final String text()
      The text/query to provide suggestions for.

      API name: text

    • tokenLimit

      @Nullable public final Integer tokenLimit()
      API name: token_limit
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Overrides:
      serializeInternal in class SuggesterBase
    • setupPhraseSuggesterDeserializer

      protected static void setupPhraseSuggesterDeserializer(ObjectDeserializer<PhraseSuggester.Builder> op)