Class PhraseSuggestion
- java.lang.Object
-
- org.elasticsearch.search.suggest.Suggest.Suggestion<PhraseSuggestion.Entry>
-
- org.elasticsearch.search.suggest.phrase.PhraseSuggestion
-
- All Implemented Interfaces:
java.lang.Iterable<PhraseSuggestion.Entry>
,Streamable
,ToXContent
,ToXContentFragment
public class PhraseSuggestion extends Suggest.Suggestion<PhraseSuggestion.Entry>
Suggestion entry returned from thePhraseSuggester
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PhraseSuggestion.Entry
-
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.lang.String
NAME
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 PhraseSuggestion()
PhraseSuggestion(java.lang.String name, int size)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PhraseSuggestion
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 PhraseSuggestion.Entry
newEntry()
-
Methods inherited from class org.elasticsearch.search.suggest.Suggest.Suggestion
addTerm, fromXContent, getEntries, getName, getSize, innerReadFrom, innerWriteTo, iterator, parseEntries, readFrom, reduce, sortComparator, 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
-
TYPE
public static final int TYPE
- See Also:
- Constant Field Values
-
-
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<PhraseSuggestion.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<PhraseSuggestion.Entry>
-
newEntry
protected PhraseSuggestion.Entry newEntry()
- Overrides:
newEntry
in classSuggest.Suggestion<PhraseSuggestion.Entry>
-
fromXContent
public static PhraseSuggestion fromXContent(XContentParser parser, java.lang.String name) throws java.io.IOException
- Throws:
java.io.IOException
-
-