Class CustomSuggestionBuilder
- java.lang.Object
-
- org.opensearch.search.suggest.SuggestionBuilder<CustomSuggestionBuilder>
-
- org.opensearch.example.customsuggester.CustomSuggestionBuilder
-
- All Implemented Interfaces:
NamedWriteable,Writeable,ToXContent,ToXContentFragment
public class CustomSuggestionBuilder extends SuggestionBuilder<CustomSuggestionBuilder>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opensearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Nested classes/interfaces inherited from interface org.opensearch.common.io.stream.Writeable
Writeable.Reader<V extends java.lang.Object>, Writeable.Writer<V extends java.lang.Object>
-
-
Field Summary
Fields Modifier and Type Field Description protected static ParseFieldRANDOM_SUFFIX_FIELDstatic java.lang.StringSUGGESTION_NAME-
Fields inherited from class org.opensearch.search.suggest.SuggestionBuilder
analyzer, ANALYZER_FIELD, field, FIELDNAME_FIELD, prefix, PREFIX_FIELD, regex, REGEX_FIELD, shardSize, SHARDSIZE_FIELD, size, SIZE_FIELD, text, TEXT_FIELD
-
Fields inherited from interface org.opensearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description CustomSuggestionBuilder(java.lang.String randomField, java.lang.String randomSuffix)CustomSuggestionBuilder(StreamInput in)Read from a stream.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SuggestionSearchContext.SuggestionContextbuild(QueryShardContext context)protected booleandoEquals(CustomSuggestionBuilder other)protected intdoHashCode()voiddoWriteTo(StreamOutput out)static CustomSuggestionBuilderfromXContent(XContentParser parser)java.lang.StringgetWriteableName()protected XContentBuilderinnerToXContent(XContentBuilder builder, ToXContent.Params params)-
Methods inherited from class org.opensearch.search.suggest.SuggestionBuilder
analyzer, analyzer, equals, field, hashCode, populateCommonFields, prefix, prefix, regex, regex, shardSize, shardSize, size, size, text, text, toXContent, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.opensearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
SUGGESTION_NAME
public static final java.lang.String SUGGESTION_NAME
- See Also:
- Constant Field Values
-
RANDOM_SUFFIX_FIELD
protected static final ParseField RANDOM_SUFFIX_FIELD
-
-
Constructor Detail
-
CustomSuggestionBuilder
public CustomSuggestionBuilder(java.lang.String randomField, java.lang.String randomSuffix)
-
CustomSuggestionBuilder
public CustomSuggestionBuilder(StreamInput in) throws java.io.IOException
Read from a stream.- Throws:
java.io.IOException
-
-
Method Detail
-
doWriteTo
public void doWriteTo(StreamOutput out) throws java.io.IOException
- Specified by:
doWriteToin classSuggestionBuilder<CustomSuggestionBuilder>- Throws:
java.io.IOException
-
innerToXContent
protected XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
innerToXContentin classSuggestionBuilder<CustomSuggestionBuilder>- Throws:
java.io.IOException
-
getWriteableName
public java.lang.String getWriteableName()
-
doEquals
protected boolean doEquals(CustomSuggestionBuilder other)
- Specified by:
doEqualsin classSuggestionBuilder<CustomSuggestionBuilder>
-
doHashCode
protected int doHashCode()
- Specified by:
doHashCodein classSuggestionBuilder<CustomSuggestionBuilder>
-
fromXContent
public static CustomSuggestionBuilder fromXContent(XContentParser parser) throws java.io.IOException
- Throws:
java.io.IOException
-
build
public SuggestionSearchContext.SuggestionContext build(QueryShardContext context) throws java.io.IOException
- Specified by:
buildin classSuggestionBuilder<CustomSuggestionBuilder>- Throws:
java.io.IOException
-
-