Class FieldSuggester

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

@JsonpDeserializable
public class FieldSuggester
extends java.lang.Object
implements OpenTaggedUnion<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)
    • prefix

      @Nullable public final java.lang.String prefix()
      API name: prefix
    • regex

      @Nullable public final java.lang.String regex()
      API name: regex
    • text

      @Nullable public final java.lang.String text()
      API name: text
    • 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.
    • 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.
    • _isCustom

      public boolean _isCustom()
      Is this a custom FieldSuggester defined by a plugin?
    • _customKind

      @Nullable public final java.lang.String _customKind()
      Get the actual kind when _kind() equals FieldSuggester.Kind._Custom (plugin-defined variant).
      Specified by:
      _customKind in interface OpenTaggedUnion<FieldSuggester.Kind,​java.lang.Object>
    • _custom

      public JsonData _custom()
      Get the custom plugin-defined variant value.
      Throws:
      java.lang.IllegalStateException - if the current variant is not FieldSuggester.Kind._Custom.
    • serialize

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

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • setupFieldSuggesterDeserializer

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