Class CustomSuggestion
java.lang.Object
org.opensearch.search.suggest.Suggest.Suggestion<CustomSuggestion.Entry>
org.opensearch.example.customsuggester.CustomSuggestion
- All Implemented Interfaces:
Iterable<CustomSuggestion.Entry>,NamedWriteable,Writeable,org.opensearch.core.xcontent.ToXContent,org.opensearch.core.xcontent.ToXContentFragment
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.opensearch.common.io.stream.Writeable
Writeable.Reader<V extends Object>, Writeable.Writer<V extends Object> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.opensearch.core.ParseFieldstatic final intFields inherited from class org.opensearch.search.suggest.Suggest.Suggestion
entries, name, sizeFields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CustomSuggestionfromXContent(org.opensearch.core.xcontent.XContentParser parser, String name) getDummy()A meaningless value used to test that plugin suggesters can add fields to their Suggestion types This can't be serialized to xcontent because Suggestions appear in xcontent as an array of entries, so there is no place to add a custom field.intprotected CustomSuggestion.EntrynewEntry(StreamInput in) voidwriteTo(StreamOutput out) Methods inherited from class org.opensearch.search.suggest.Suggest.Suggestion
addTerm, equals, fromXContent, getEntries, getName, getSize, hashCode, iterator, parseEntries, reduce, sortComparator, toXContent, trimMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.opensearch.core.xcontent.ToXContentFragment
isFragment
-
Field Details
-
TYPE
public static final int TYPE- See Also:
-
DUMMY
public static final org.opensearch.core.ParseField DUMMY
-
-
Constructor Details
-
CustomSuggestion
-
CustomSuggestion
- Throws:
IOException
-
-
Method Details
-
writeTo
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classSuggest.Suggestion<CustomSuggestion.Entry>- Throws:
IOException
-
getWriteableName
- Specified by:
getWriteableNamein interfaceNamedWriteable- Specified by:
getWriteableNamein classSuggest.Suggestion<CustomSuggestion.Entry>
-
getWriteableType
public int getWriteableType()- Overrides:
getWriteableTypein classSuggest.Suggestion<CustomSuggestion.Entry>
-
getDummy
A meaningless value used to test that plugin suggesters can add fields to their Suggestion types This can't be serialized to xcontent because Suggestions appear in xcontent as an array of entries, so there is no place to add a custom field. But we can still use a custom field internally and use it to define a Suggestion's behavior -
newEntry
- Specified by:
newEntryin classSuggest.Suggestion<CustomSuggestion.Entry>- Throws:
IOException
-
fromXContent
public static CustomSuggestion fromXContent(org.opensearch.core.xcontent.XContentParser parser, String name) throws IOException - Throws:
IOException
-