Class FieldSuggester
java.lang.Object
co.elastic.clients.elasticsearch.core.search.FieldSuggester
- All Implemented Interfaces:
JsonpSerializable,OpenTaggedUnion<FieldSuggester.Kind,,Object> TaggedUnion<FieldSuggester.Kind,Object>
@JsonpDeserializable
public class FieldSuggester
extends Object
implements OpenTaggedUnion<FieldSuggester.Kind,Object>, JsonpSerializable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_custom()Get the custom plugin-defined variant value.final StringGet the actual kind when_kind()equalsFieldSuggester.Kind._Custom(plugin-defined variant).final Object_get()booleanIs this a customFieldSuggesterdefined by a plugin?final FieldSuggester.Kind_kind()Get the of the kind of variant held by this object.Get thecompletionvariant value.booleanIs this variant instance of kindcompletion?booleanisPhrase()Is this variant instance of kindphrase?booleanisTerm()Is this variant instance of kindterm?static FieldSuggesterphrase()Get thephrasevariant value.final Stringprefix()Prefix used to search for suggestions.final Stringregex()A prefix expressed as a regular expression.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidterm()Get thetermvariant value.final Stringtext()The text to use as input for the suggester.toString()
-
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,Object> - Returns:
- the variant kind
-
_get
- Specified by:
_getin interfaceTaggedUnion<FieldSuggester.Kind,Object>
-
of
-
prefix
Prefix used to search for suggestions.API name:
prefix -
regex
A prefix expressed as a regular expression.API name:
regex -
text
The text to use as input for the suggester. Needs to be set globally or per suggestion.API name:
text -
isCompletion
public boolean isCompletion()Is this variant instance of kindcompletion? -
completion
Get thecompletionvariant value.- Throws:
IllegalStateException- if the current variant is not of thecompletionkind.
-
isPhrase
public boolean isPhrase()Is this variant instance of kindphrase? -
phrase
Get thephrasevariant value.- Throws:
IllegalStateException- if the current variant is not of thephrasekind.
-
isTerm
public boolean isTerm()Is this variant instance of kindterm? -
term
Get thetermvariant value.- Throws:
IllegalStateException- if the current variant is not of thetermkind.
-
_isCustom
public boolean _isCustom()Is this a customFieldSuggesterdefined by a plugin? -
_customKind
Get the actual kind when_kind()equalsFieldSuggester.Kind._Custom(plugin-defined variant).- Specified by:
_customKindin interfaceOpenTaggedUnion<FieldSuggester.Kind,Object>
-
_custom
Get the custom plugin-defined variant value.- Throws:
IllegalStateException- if the current variant is notFieldSuggester.Kind._Custom.
-
serialize
- Specified by:
serializein interfaceJsonpSerializable
-
toString
-
setupFieldSuggesterDeserializer
protected static void setupFieldSuggesterDeserializer(ObjectDeserializer<FieldSuggester.Builder> op)
-