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>,Streamable,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.Score-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<Suggest.Suggestion.Entry.Option>FREQUENCYstatic java.lang.StringNAMEstatic java.util.Comparator<Suggest.Suggestion.Entry.Option>SCOREstatic intTYPE-
Fields inherited from class org.elasticsearch.search.suggest.Suggest.Suggestion
entries, name, size
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Constructor Description TermSuggestion()TermSuggestion(java.lang.String name, int size, SortBy sort)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static TermSuggestionfromXContent(XContentParser parser, java.lang.String name)protected java.lang.StringgetType()Returns a string representing the type of the suggestion.intgetWriteableType()Returns a integer representing the type of the suggestion.protected voidinnerReadFrom(StreamInput in)voidinnerWriteTo(StreamOutput out)protected TermSuggestion.EntrynewEntry()protected java.util.Comparator<Suggest.Suggestion.Entry.Option>sortComparator()-
Methods inherited from class org.elasticsearch.search.suggest.Suggest.Suggestion
addTerm, fromXContent, getEntries, getName, getSize, iterator, parseEntries, readFrom, reduce, toXContent, trim, writeTo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
SCORE
public static final java.util.Comparator<Suggest.Suggestion.Entry.Option> SCORE
-
FREQUENCY
public static final java.util.Comparator<Suggest.Suggestion.Entry.Option> FREQUENCY
-
TYPE
public static final int TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TermSuggestion
public TermSuggestion()
-
TermSuggestion
public TermSuggestion(java.lang.String name, int size, SortBy sort)
-
-
Method Detail
-
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.- Overrides:
getWriteableTypein classSuggest.Suggestion<TermSuggestion.Entry>
-
getType
protected java.lang.String getType()
Description copied from class:Suggest.SuggestionReturns a string representing the type of the suggestion. This type is added to the suggestion name in the XContent response, so that it can later be used by REST clients to determine the internal type of the suggestion.- Overrides:
getTypein classSuggest.Suggestion<TermSuggestion.Entry>
-
sortComparator
protected java.util.Comparator<Suggest.Suggestion.Entry.Option> sortComparator()
- Overrides:
sortComparatorin classSuggest.Suggestion<TermSuggestion.Entry>
-
innerReadFrom
protected void innerReadFrom(StreamInput in) throws java.io.IOException
- Overrides:
innerReadFromin classSuggest.Suggestion<TermSuggestion.Entry>- Throws:
java.io.IOException
-
innerWriteTo
public void innerWriteTo(StreamOutput out) throws java.io.IOException
- Overrides:
innerWriteToin classSuggest.Suggestion<TermSuggestion.Entry>- Throws:
java.io.IOException
-
fromXContent
public static TermSuggestion fromXContent(XContentParser parser, java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
newEntry
protected TermSuggestion.Entry newEntry()
- Overrides:
newEntryin classSuggest.Suggestion<TermSuggestion.Entry>
-
-