Module org.elasticsearch.server
Class CompletionSuggestion
java.lang.Object
org.elasticsearch.search.suggest.Suggest.Suggestion<CompletionSuggestion.Entry>
org.elasticsearch.search.suggest.completion.CompletionSuggestion
- All Implemented Interfaces:
- Iterable<CompletionSuggestion.Entry>,- NamedWriteable,- Writeable,- ToXContent,- ToXContentFragment
Suggestion response for 
CompletionSuggester results
 Response format for each entry:
 {
     "text" : STRING
     "score" : FLOAT
     "contexts" : CONTEXTS
 }
 CONTEXTS : {
     "CONTEXT_NAME" : ARRAY,
     ..
 }- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContentToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.WriteableWriteable.Reader<V>, Writeable.Writer<V>
- 
Field SummaryFields inherited from class org.elasticsearch.search.suggest.Suggest.Suggestionentries, name, size, TYPEFields inherited from interface org.elasticsearch.xcontent.ToXContentEMPTY_PARAMS
- 
Constructor SummaryConstructorsConstructorDescriptionCompletionSuggestion(String name, int size, boolean skipDuplicates) Creates a completion suggestion given its name, size and whether it should skip duplicates
- 
Method SummaryModifier and TypeMethodDescriptionbooleanstatic CompletionSuggestionfromXContent(XContentParser parser, String name) Returns the name of the writeable objectinthashCode()booleanprotected CompletionSuggestion.EntrynewEntry(StreamInput in) reduce(List<Suggest.Suggestion<CompletionSuggestion.Entry>> toReduce) Merges the result of another suggestion into this suggestion.voidsetShardIndex(int shardIndex) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.search.suggest.Suggest.SuggestionaddTerm, fromXContent, getEntries, getName, getSize, iterator, parseEntries, sortComparator, toXContent, trimMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragmentisFragment
- 
Constructor Details- 
CompletionSuggestionCreates a completion suggestion given its name, size and whether it should skip duplicates- Parameters:
- name- The name for the suggestions
- size- The number of suggestions to return
- skipDuplicates- Whether duplicate suggestions should be filtered out
 
- 
CompletionSuggestion- Throws:
- IOException
 
 
- 
- 
Method Details- 
getWriteableNameDescription copied from interface:NamedWriteableReturns the name of the writeable object- Specified by:
- getWriteableNamein interface- NamedWriteable
- Specified by:
- getWriteableNamein class- Suggest.Suggestion<CompletionSuggestion.Entry>
 
- 
writeToDescription copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
- writeToin interface- Writeable
- Overrides:
- writeToin class- Suggest.Suggestion<CompletionSuggestion.Entry>
- Throws:
- IOException
 
- 
getOptions- Returns:
- the result options for the suggestion
 
- 
hasScoreDocspublic boolean hasScoreDocs()- Returns:
- whether there is any hits for the suggestion
 
- 
equals- Overrides:
- equalsin class- Suggest.Suggestion<CompletionSuggestion.Entry>
 
- 
hashCodepublic int hashCode()- Overrides:
- hashCodein class- Suggest.Suggestion<CompletionSuggestion.Entry>
 
- 
fromXContentpublic static CompletionSuggestion fromXContent(XContentParser parser, String name) throws IOException - Throws:
- IOException
 
- 
reduceDescription copied from class:Suggest.SuggestionMerges the result of another suggestion into this suggestion. For internal usage.- Overrides:
- reducein class- Suggest.Suggestion<CompletionSuggestion.Entry>
 
- 
setShardIndexpublic void setShardIndex(int shardIndex) 
- 
newEntry- Specified by:
- newEntryin class- Suggest.Suggestion<CompletionSuggestion.Entry>
- Throws:
- IOException
 
 
-