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 class
FieldSuggester.Builder
static class
FieldSuggester.Kind
FieldSuggester
variant 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 customFieldSuggester
defined by a plugin?FieldSuggester.Kind
_kind()
Get the of the kind of variant held by this object.CompletionSuggester
completion()
Get thecompletion
variant value.boolean
isCompletion()
Is this variant instance of kindcompletion
?boolean
isPhrase()
Is this variant instance of kindphrase
?boolean
isTerm()
Is this variant instance of kindterm
?static FieldSuggester
of(java.util.function.Function<FieldSuggester.Builder,ObjectBuilder<FieldSuggester>> fn)
PhraseSuggester
phrase()
Get thephrase
variant value.java.lang.String
prefix()
API name:prefix
java.lang.String
regex()
API name:regex
void
serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
protected static void
setupFieldSuggesterDeserializer(ObjectDeserializer<FieldSuggester.Builder> op)
TermSuggester
term()
Get theterm
variant value.java.lang.String
text()
API name:text
java.lang.String
toString()
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:TaggedUnion
Get the of the kind of variant held by this object.- Specified by:
_kind
in interfaceTaggedUnion<FieldSuggester.Kind,java.lang.Object>
- Returns:
- the variant kind
-
_get
public final java.lang.Object _get()- Specified by:
_get
in 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 thecompletion
variant value.- Throws:
java.lang.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:
java.lang.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:
java.lang.IllegalStateException
- if the current variant is not of theterm
kind.
-
_isCustom
public boolean _isCustom()Is this a customFieldSuggester
defined 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:
_customKind
in 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:
serialize
in interfaceJsonpSerializable
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
setupFieldSuggesterDeserializer
protected static void setupFieldSuggesterDeserializer(ObjectDeserializer<FieldSuggester.Builder> op)
-