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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription_custom()
Get the custom plugin-defined variant value.final String
Get the actual kind when_kind()
equalsFieldSuggester.Kind._Custom
(plugin-defined variant).final Object
_get()
boolean
Is this a customFieldSuggester
defined by a plugin?final FieldSuggester.Kind
_kind()
Get the of the kind of variant held by this object.Get thecompletion
variant value.boolean
Is this variant instance of kindcompletion
?boolean
isPhrase()
Is this variant instance of kindphrase
?boolean
isTerm()
Is this variant instance of kindterm
?static FieldSuggester
phrase()
Get thephrase
variant value.final String
prefix()
Prefix used to search for suggestions.final String
regex()
A prefix expressed as a regular expression.void
serialize
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
term()
Get theterm
variant value.final String
text()
The text to use as input for the suggester.toString()
-
Field Details
-
_DESERIALIZER
-
-
Constructor Details
-
FieldSuggester
-
-
Method Details
-
_kind
Description copied from interface:TaggedUnion
Get the of the kind of variant held by this object.- Specified by:
_kind
in interfaceTaggedUnion<FieldSuggester.Kind,
Object> - Returns:
- the variant kind
-
_get
- Specified by:
_get
in 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 thecompletion
variant value.- Throws:
IllegalStateException
- if the current variant is not of thecompletion
kind.
-
isPhrase
public boolean isPhrase()Is this variant instance of kindphrase
? -
phrase
Get thephrase
variant value.- Throws:
IllegalStateException
- if the current variant is not of thephrase
kind.
-
isTerm
public boolean isTerm()Is this variant instance of kindterm
? -
term
Get theterm
variant value.- Throws:
IllegalStateException
- if the current variant is not of theterm
kind.
-
_isCustom
public boolean _isCustom()Is this a customFieldSuggester
defined by a plugin? -
_customKind
Get the actual kind when_kind()
equalsFieldSuggester.Kind._Custom
(plugin-defined variant).- Specified by:
_customKind
in 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:
serialize
in interfaceJsonpSerializable
-
toString
-
setupFieldSuggesterDeserializer
protected static void setupFieldSuggesterDeserializer(ObjectDeserializer<FieldSuggester.Builder> op)
-