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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldSuggester.Builderstatic classFieldSuggester.KindFieldSuggestervariant kinds. -
Field Summary
Fields Modifier and Type Field Description static JsonpDeserializer<FieldSuggester>_DESERIALIZER -
Constructor Summary
Constructors Constructor Description FieldSuggester(FieldSuggesterVariant value) -
Method Summary
Modifier and Type Method Description JsonData_custom()Get the custom plugin-defined variant value.java.lang.String_customKind()Get the actual kind when_kind()equalsFieldSuggester.Kind._Custom(plugin-defined variant).java.lang.Object_get()boolean_isCustom()Is this a customFieldSuggesterdefined by a plugin?FieldSuggester.Kind_kind()Get the of the kind of variant held by this object.CompletionSuggestercompletion()Get thecompletionvariant value.booleanisCompletion()Is this variant instance of kindcompletion?booleanisPhrase()Is this variant instance of kindphrase?booleanisTerm()Is this variant instance of kindterm?static FieldSuggesterof(java.util.function.Function<FieldSuggester.Builder,ObjectBuilder<FieldSuggester>> fn)PhraseSuggesterphrase()Get thephrasevariant value.java.lang.Stringprefix()API name:prefixjava.lang.Stringregex()API name:regexvoidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)protected static voidsetupFieldSuggesterDeserializer(ObjectDeserializer<FieldSuggester.Builder> op)TermSuggesterterm()Get thetermvariant value.java.lang.Stringtext()API name:textjava.lang.StringtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
_DESERIALIZER
-
-
Constructor Details
-
FieldSuggester
-
-
Method Details
-
_kind
Description copied from interface:TaggedUnionGet the of the kind of variant held by this object.- Specified by:
_kindin interfaceTaggedUnion<FieldSuggester.Kind,java.lang.Object>- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()- Specified by:
_getin interfaceTaggedUnion<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 kindcompletion? -
completion
Get thecompletionvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thecompletionkind.
-
isPhrase
public boolean isPhrase()Is this variant instance of kindphrase? -
phrase
Get thephrasevariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thephrasekind.
-
isTerm
public boolean isTerm()Is this variant instance of kindterm? -
term
Get thetermvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetermkind.
-
_isCustom
public boolean _isCustom()Is this a customFieldSuggesterdefined by a plugin? -
_customKind
@Nullable public final java.lang.String _customKind()Get the actual kind when_kind()equalsFieldSuggester.Kind._Custom(plugin-defined variant).- Specified by:
_customKindin interfaceOpenTaggedUnion<FieldSuggester.Kind,java.lang.Object>
-
_custom
Get the custom plugin-defined variant value.- Throws:
java.lang.IllegalStateException- if the current variant is notFieldSuggester.Kind._Custom.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
setupFieldSuggesterDeserializer
protected static void setupFieldSuggesterDeserializer(ObjectDeserializer<FieldSuggester.Builder> op)
-