Class FieldSuggester
- java.lang.Object
-
- org.opensearch.client.opensearch.core.search.FieldSuggester
-
- All Implemented Interfaces:
JsonpSerializable,TaggedUnion<FieldSuggester.Kind,java.lang.Object>
@JsonpDeserializable public class FieldSuggester extends java.lang.Object implements TaggedUnion<FieldSuggester.Kind,java.lang.Object>, JsonpSerializable
-
-
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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object_get()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:text
-
-
-
Field Detail
-
_DESERIALIZER
public static final JsonpDeserializer<FieldSuggester> _DESERIALIZER
-
-
Constructor Detail
-
FieldSuggester
public FieldSuggester(FieldSuggesterVariant value)
-
-
Method Detail
-
_kind
public final FieldSuggester.Kind _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
public CompletionSuggester 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
public PhraseSuggester 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
public TermSuggester term()
Get thetermvariant value.- Throws:
java.lang.IllegalStateException- if the current variant is not of thetermkind.
-
serialize
public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)- Specified by:
serializein interfaceJsonpSerializable
-
setupFieldSuggesterDeserializer
protected static void setupFieldSuggesterDeserializer(ObjectDeserializer<FieldSuggester.Builder> op)
-
-