Class TermSuggestion
java.lang.Object
org.elasticsearch.search.suggest.Suggest.Suggestion<TermSuggestion.Entry>
org.elasticsearch.search.suggest.term.TermSuggestion
- All Implemented Interfaces:
Iterable<TermSuggestion.Entry>
,NamedWriteable
,Writeable
,ToXContent
,ToXContentFragment
The suggestion responses corresponding with the suggestions in the request.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents a part from the suggest text with suggested options.static class
static class
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Comparator<Suggest.Suggestion.Entry.Option>
static final Comparator<Suggest.Suggestion.Entry.Option>
static final int
Deprecated.Fields inherited from class org.elasticsearch.search.suggest.Suggest.Suggestion
entries, name, size
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static TermSuggestion
fromXContent
(XContentParser parser, String name) getSort()
Returns the name of the writeable objectint
Returns a integer representing the type of the suggestion.int
hashCode()
protected TermSuggestion.Entry
newEntry
(StreamInput in) void
protected Comparator<Suggest.Suggestion.Entry.Option>
void
writeTo
(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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
TYPE
Deprecated.- See Also:
-
SCORE
-
FREQUENCY
-
-
Constructor Details
-
TermSuggestion
-
TermSuggestion
- Throws:
IOException
-
-
Method Details
-
getWriteableType
public int getWriteableType()Description copied from class:Suggest.Suggestion
Returns 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:
getWriteableType
in classSuggest.Suggestion<TermSuggestion.Entry>
-
setSort
-
getSort
-
sortComparator
- Overrides:
sortComparator
in classSuggest.Suggestion<TermSuggestion.Entry>
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classSuggest.Suggestion<TermSuggestion.Entry>
- Throws:
IOException
-
getWriteableName
Description copied from interface:NamedWriteable
Returns the name of the writeable object- Specified by:
getWriteableName
in interfaceNamedWriteable
- Specified by:
getWriteableName
in classSuggest.Suggestion<TermSuggestion.Entry>
-
fromXContent
- Throws:
IOException
-
newEntry
- Specified by:
newEntry
in classSuggest.Suggestion<TermSuggestion.Entry>
- Throws:
IOException
-
equals
- Overrides:
equals
in classSuggest.Suggestion<TermSuggestion.Entry>
-
hashCode
public int hashCode()- Overrides:
hashCode
in classSuggest.Suggestion<TermSuggestion.Entry>
-