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 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
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.Comparator<Suggest.Suggestion.Entry.Option>
FREQUENCY
static java.lang.String
NAME
static java.util.Comparator<Suggest.Suggestion.Entry.Option>
SCORE
static int
TYPE
-
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
Modifier and Type Method Description static TermSuggestion
fromXContent(XContentParser parser, java.lang.String name)
protected java.lang.String
getType()
Returns a string representing the type of the suggestion.int
getWriteableType()
Returns a integer representing the type of the suggestion.protected void
innerReadFrom(StreamInput in)
void
innerWriteTo(StreamOutput out)
protected TermSuggestion.Entry
newEntry()
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.Suggestion
Returns a integer representing the type of the suggestion. This is used for internal serialization over the network.- Overrides:
getWriteableType
in classSuggest.Suggestion<TermSuggestion.Entry>
-
getType
protected java.lang.String getType()
Description copied from class:Suggest.Suggestion
Returns 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:
getType
in classSuggest.Suggestion<TermSuggestion.Entry>
-
sortComparator
protected java.util.Comparator<Suggest.Suggestion.Entry.Option> sortComparator()
- Overrides:
sortComparator
in classSuggest.Suggestion<TermSuggestion.Entry>
-
innerReadFrom
protected void innerReadFrom(StreamInput in) throws java.io.IOException
- Overrides:
innerReadFrom
in classSuggest.Suggestion<TermSuggestion.Entry>
- Throws:
java.io.IOException
-
innerWriteTo
public void innerWriteTo(StreamOutput out) throws java.io.IOException
- Overrides:
innerWriteTo
in 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:
newEntry
in classSuggest.Suggestion<TermSuggestion.Entry>
-
-