Streamable, ToXContent, ToXContentFragmentpublic 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 | Description |
|---|---|---|
static class |
CompletionSuggestion.Entry |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
NAME |
|
static int |
TYPE |
entries, name, sizeEMPTY_PARAMS| Constructor | Description |
|---|---|
CompletionSuggestion() |
|
CompletionSuggestion(java.lang.String name,
int size,
boolean skipDuplicates) |
Ctr
|
| Modifier and Type | Method | 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() |
|
void |
readFrom(StreamInput in) |
Set this object's fields from a StreamInput.
|
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) |
|
void |
writeTo(StreamOutput out) |
Write this object's fields to a StreamOutput.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnewWriteableReaderaddTerm, fromXContent, getEntries, getName, getSize, innerReadFrom, innerWriteTo, iterator, parseEntries, sortComparator, toXContent, trimisFragmentpublic static final java.lang.String NAME
public static final int TYPE
public CompletionSuggestion()
public CompletionSuggestion(java.lang.String name,
int size,
boolean skipDuplicates)
name - The name for the suggestionssize - The number of suggestions to returnskipDuplicates - Whether duplicate suggestions should be filtered outpublic void readFrom(StreamInput in) throws java.io.IOException
StreamablereadFrom in interface StreamablereadFrom in class Suggest.Suggestion<CompletionSuggestion.Entry>java.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
StreamablewriteTo in interface StreamablewriteTo in class Suggest.Suggestion<CompletionSuggestion.Entry>java.io.IOExceptionpublic 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>