Class FieldSuggester

java.lang.Object
co.elastic.clients.elasticsearch.core.search.FieldSuggester
All Implemented Interfaces:
JsonpSerializable, TaggedUnion<FieldSuggester.Kind,​java.lang.Object>

@JsonpDeserializable
public class FieldSuggester
extends java.lang.Object
implements TaggedUnion<FieldSuggester.Kind,​java.lang.Object>, JsonpSerializable
See Also:
API specification
  • Field Details

  • Constructor Details

  • Method Details

    • _kind

      public final FieldSuggester.Kind _kind()
      Description copied from interface: TaggedUnion
      Get the of the kind of variant held by this object.
      Specified by:
      _kind in interface TaggedUnion<FieldSuggester.Kind,​java.lang.Object>
      Returns:
      the variant kind
    • _get

      public final java.lang.Object _get()
      Specified by:
      _get in interface TaggedUnion<FieldSuggester.Kind,​java.lang.Object>
    • of

      public static FieldSuggester of​(java.util.function.Function<FieldSuggester.Builder,​ObjectBuilder<FieldSuggester>> fn)
    • isCompletion

      public boolean isCompletion()
      Is this variant instance of kind completion?
    • completion

      public CompletionSuggester completion()
      Get the completion variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the completion kind.
    • isPhrase

      public boolean isPhrase()
      Is this variant instance of kind phrase?
    • phrase

      public PhraseSuggester phrase()
      Get the phrase variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the phrase kind.
    • isPrefix

      public boolean isPrefix()
      Is this variant instance of kind prefix?
    • prefix

      public java.lang.String prefix()
      Get the prefix variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the prefix kind.
    • isRegex

      public boolean isRegex()
      Is this variant instance of kind regex?
    • regex

      public java.lang.String regex()
      Get the regex variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the regex kind.
    • isTerm

      public boolean isTerm()
      Is this variant instance of kind term?
    • term

      public TermSuggester term()
      Get the term variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the term kind.
    • isText

      public boolean isText()
      Is this variant instance of kind text?
    • text

      public java.lang.String text()
      Get the text variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not of the text kind.
    • serialize

      public void serialize​(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Specified by:
      serialize in interface JsonpSerializable
    • setupFieldSuggesterDeserializer

      protected static void setupFieldSuggesterDeserializer​(ObjectDeserializer<FieldSuggester.Builder> op)