Class TermSuggestion
java.lang.Object
org.elasticsearch.search.suggest.Suggest.Suggestion<TermSuggestion.Entry>
org.elasticsearch.search.suggest.term.TermSuggestion
- All Implemented Interfaces:
java.lang.Iterable<TermSuggestion.Entry>,NamedWriteable,Writeable,ToXContent,ToXContentFragment
public class TermSuggestion extends Suggest.Suggestion<TermSuggestion.Entry>
The suggestion responses corresponding with the suggestions in the request.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTermSuggestion.EntryRepresents a part from the suggest text with suggested options.static classTermSuggestion.Frequencystatic classTermSuggestion.ScoreNested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<Suggest.Suggestion.Entry.Option>FREQUENCYstatic java.util.Comparator<Suggest.Suggestion.Entry.Option>SCOREstatic intTYPEDeprecated. -
Constructor Summary
Constructors Constructor Description TermSuggestion(java.lang.String name, int size, SortBy sort)TermSuggestion(StreamInput in) -
Method Summary
Modifier and Type Method Description booleanequals(java.lang.Object other)static TermSuggestionfromXContent(XContentParser parser, java.lang.String name)SortBygetSort()java.lang.StringgetWriteableName()Returns the name of the writeable objectintgetWriteableType()Returns a integer representing the type of the suggestion.inthashCode()protected TermSuggestion.EntrynewEntry(StreamInput in)voidsetSort(SortBy sort)protected java.util.Comparator<Suggest.Suggestion.Entry.Option>sortComparator()voidwriteTo(StreamOutput out)Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.suggest.Suggest.Suggestion
addTerm, fromXContent, getEntries, getName, getSize, iterator, parseEntries, reduce, toXContent, trim
-
Field Details
-
TYPE
@Deprecated public static final int TYPEDeprecated.- See Also:
- Constant Field Values
-
SCORE
-
FREQUENCY
-
-
Constructor Details
-
TermSuggestion
-
TermSuggestion
- Throws:
java.io.IOException
-
-
Method Details
-
getWriteableType
public int getWriteableType()Description copied from class:Suggest.SuggestionReturns a integer representing the type of the suggestion. This is used for internal serialization over the network. This class is now serialized as a NamedWriteable and this method only remains for backwards compatibility- Overrides:
getWriteableTypein classSuggest.Suggestion<TermSuggestion.Entry>
-
setSort
-
getSort
-
sortComparator
- Overrides:
sortComparatorin classSuggest.Suggestion<TermSuggestion.Entry>
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classSuggest.Suggestion<TermSuggestion.Entry>- Throws:
java.io.IOException
-
getWriteableName
public java.lang.String getWriteableName()Description copied from interface:NamedWriteableReturns the name of the writeable object- Specified by:
getWriteableNamein interfaceNamedWriteable- Specified by:
getWriteableNamein classSuggest.Suggestion<TermSuggestion.Entry>
-
fromXContent
public static TermSuggestion fromXContent(XContentParser parser, java.lang.String name) throws java.io.IOException- Throws:
java.io.IOException
-
newEntry
- Specified by:
newEntryin classSuggest.Suggestion<TermSuggestion.Entry>- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object other)- Overrides:
equalsin classSuggest.Suggestion<TermSuggestion.Entry>
-
hashCode
public int hashCode()- Overrides:
hashCodein classSuggest.Suggestion<TermSuggestion.Entry>
-