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 class
TermSuggestion.Entry
Represents a part from the suggest text with suggested options.static class
TermSuggestion.Frequency
static class
TermSuggestion.Score
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.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
Fields Modifier and Type Field Description static java.util.Comparator<Suggest.Suggestion.Entry.Option>
FREQUENCY
static java.util.Comparator<Suggest.Suggestion.Entry.Option>
SCORE
static int
TYPE
Deprecated.-
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)
TermSuggestion(StreamInput in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
static TermSuggestion
fromXContent(XContentParser parser, java.lang.String name)
SortBy
getSort()
java.lang.String
getWriteableName()
Returns the name of the writeable objectint
getWriteableType()
Returns a integer representing the type of the suggestion.int
hashCode()
protected TermSuggestion.Entry
newEntry()
protected TermSuggestion.Entry
newEntry(StreamInput in)
void
setSort(SortBy sort)
protected java.util.Comparator<Suggest.Suggestion.Entry.Option>
sortComparator()
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 org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
TYPE
@Deprecated public static final int TYPE
Deprecated.- 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
-
-
Constructor Detail
-
TermSuggestion
public TermSuggestion()
-
TermSuggestion
public TermSuggestion(java.lang.String name, int size, SortBy sort)
-
TermSuggestion
public TermSuggestion(StreamInput in) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
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
public void setSort(SortBy sort)
-
getSort
public SortBy getSort()
-
sortComparator
protected java.util.Comparator<Suggest.Suggestion.Entry.Option> sortComparator()
- Overrides:
sortComparator
in classSuggest.Suggestion<TermSuggestion.Entry>
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classSuggest.Suggestion<TermSuggestion.Entry>
- Throws:
java.io.IOException
-
getWriteableName
public java.lang.String 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
public static TermSuggestion fromXContent(XContentParser parser, java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
newEntry
protected TermSuggestion.Entry newEntry()
- Specified by:
newEntry
in classSuggest.Suggestion<TermSuggestion.Entry>
-
newEntry
protected TermSuggestion.Entry newEntry(StreamInput in) throws java.io.IOException
- Specified by:
newEntry
in classSuggest.Suggestion<TermSuggestion.Entry>
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classSuggest.Suggestion<TermSuggestion.Entry>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classSuggest.Suggestion<TermSuggestion.Entry>
-
-