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.ParamsNested 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_NAMEFields 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 -
Constructor Summary
Constructors Constructor Description CustomSuggestionBuilder(java.lang.String randomField, java.lang.String randomSuffix)CustomSuggestionBuilder(StreamInput in)Read from a stream. -
Method Summary
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
-
Field Details
-
SUGGESTION_NAME
public static final java.lang.String SUGGESTION_NAME- See Also:
- Constant Field Values
-
RANDOM_SUFFIX_FIELD
-
-
Constructor Details
-
CustomSuggestionBuilder
public CustomSuggestionBuilder(java.lang.String randomField, java.lang.String randomSuffix) -
CustomSuggestionBuilder
Read from a stream.- Throws:
java.io.IOException
-
-
Method Details
-
doWriteTo
- 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
- 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
-