Class CustomSuggestion
- java.lang.Object
-
- org.opensearch.search.suggest.Suggest.Suggestion<CustomSuggestion.Entry>
-
- org.opensearch.example.customsuggester.CustomSuggestion
-
- All Implemented Interfaces:
java.lang.Iterable<CustomSuggestion.Entry>,NamedWriteable,Writeable,ToXContent,ToXContentFragment
public class CustomSuggestion extends Suggest.Suggestion<CustomSuggestion.Entry>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCustomSuggestion.Entry-
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 static ParseFieldDUMMYstatic intTYPE-
Fields inherited from class org.opensearch.search.suggest.Suggest.Suggestion
entries, name, size
-
Fields inherited from interface org.opensearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description CustomSuggestion(java.lang.String name, int size, java.lang.String dummy)CustomSuggestion(StreamInput in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CustomSuggestionfromXContent(XContentParser parser, java.lang.String name)java.lang.StringgetDummy()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.java.lang.StringgetWriteableName()intgetWriteableType()protected 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, trim
-
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
-
TYPE
public static final int TYPE
- See Also:
- Constant Field Values
-
DUMMY
public static final ParseField DUMMY
-
-
Constructor Detail
-
CustomSuggestion
public CustomSuggestion(java.lang.String name, int size, java.lang.String dummy)
-
CustomSuggestion
public CustomSuggestion(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classSuggest.Suggestion<CustomSuggestion.Entry>- Throws:
java.io.IOException
-
getWriteableName
public java.lang.String getWriteableName()
- Specified by:
getWriteableNamein interfaceNamedWriteable- Specified by:
getWriteableNamein classSuggest.Suggestion<CustomSuggestion.Entry>
-
getWriteableType
public int getWriteableType()
- Overrides:
getWriteableTypein classSuggest.Suggestion<CustomSuggestion.Entry>
-
getDummy
public java.lang.String 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
protected CustomSuggestion.Entry newEntry(StreamInput in) throws java.io.IOException
- Specified by:
newEntryin classSuggest.Suggestion<CustomSuggestion.Entry>- Throws:
java.io.IOException
-
fromXContent
public static CustomSuggestion fromXContent(XContentParser parser, java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
-