public final class CompletionSuggestion extends Suggest.Suggestion<CompletionSuggestion.Entry>
CompletionSuggester results
Response format for each entry:
{
"text" : STRING
"score" : FLOAT
"contexts" : CONTEXTS
}
CONTEXTS : {
"CONTEXT_NAME" : ARRAY,
..
}| Modifier and Type | Class and Description |
|---|---|
static class |
CompletionSuggestion.Entry |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NAME |
static int |
TYPE |
entries, name, sizeEMPTY_PARAMS| Constructor and Description |
|---|
CompletionSuggestion() |
CompletionSuggestion(java.lang.String name,
int size) |
| Modifier and Type | Method and Description |
|---|---|
static CompletionSuggestion |
fromXContent(XContentParser parser,
java.lang.String name) |
java.util.List<CompletionSuggestion.Entry.Option> |
getOptions() |
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.
|
boolean |
hasScoreDocs() |
protected CompletionSuggestion.Entry |
newEntry() |
Suggest.Suggestion<CompletionSuggestion.Entry> |
reduce(java.util.List<Suggest.Suggestion<CompletionSuggestion.Entry>> toReduce)
Merges the result of another suggestion into this suggestion.
|
static CompletionSuggestion |
reduceTo(java.util.List<Suggest.Suggestion<CompletionSuggestion.Entry>> toReduce)
Reduces suggestions to a single suggestion containing at most
top
Suggest.Suggestion.getSize() options across toReduce |
void |
setShardIndex(int shardIndex) |
addTerm, fromXContent, getEntries, getName, getSize, innerReadFrom, innerWriteTo, iterator, parseEntries, readFrom, sortComparator, toXContent, trim, writeToclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisFragmentpublic static final java.lang.String NAME
public static final int TYPE
public CompletionSuggestion()
public CompletionSuggestion(java.lang.String name,
int size)
public java.util.List<CompletionSuggestion.Entry.Option> getOptions()
public boolean hasScoreDocs()
public static CompletionSuggestion fromXContent(XContentParser parser, java.lang.String name) throws java.io.IOException
java.io.IOExceptionpublic static CompletionSuggestion reduceTo(java.util.List<Suggest.Suggestion<CompletionSuggestion.Entry>> toReduce)
Suggest.Suggestion.getSize() options across toReducepublic Suggest.Suggestion<CompletionSuggestion.Entry> reduce(java.util.List<Suggest.Suggestion<CompletionSuggestion.Entry>> toReduce)
Suggest.Suggestionreduce in class Suggest.Suggestion<CompletionSuggestion.Entry>public void setShardIndex(int shardIndex)
public int getWriteableType()
Suggest.SuggestiongetWriteableType in class Suggest.Suggestion<CompletionSuggestion.Entry>protected java.lang.String getType()
Suggest.SuggestiongetType in class Suggest.Suggestion<CompletionSuggestion.Entry>protected CompletionSuggestion.Entry newEntry()
newEntry in class Suggest.Suggestion<CompletionSuggestion.Entry>