Package org.elasticsearch.search.suggest
Class Suggest
org.elasticsearch.search.suggest.Suggest
- All Implemented Interfaces:
<Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>>
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentFragment
public class Suggest
extends
implements <Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>>, Writeable, org.elasticsearch.common.xcontent.ToXContentFragment
Top level suggest result, containing the result for each suggestion.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Suggest.Suggestion<T extends Suggest.Suggestion.Entry>
The suggestion responses corresponding with the suggestions in the request.Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
FieldsFields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorsConstructorDescription<Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>> suggestions)
Suggest(StreamInput in)
-
Method Summary
Modifier and TypeMethodDescriptionboolean
other)
<T extends <T>
<T> suggestionType)
static Suggest
fromXContent(org.elasticsearch.common.xcontent.XContentParser parser)
this parsing method assumes that the leading "suggest" field name has already been parsed by the caller<T extends Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>>
Tname)
int
hashCode()
boolean
Whether any suggestions had query hits<Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>>
iterator()
static <Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>>
<,<Suggest.Suggestion>> groupedSuggestions)
int
size()
The number of suggestions in thisSuggest
resulttoString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class java.lang.
, , , , , , ,
Methods inherited from interface java.lang.
,
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
Field Details
-
NAME
public static final NAME- See Also:
- Constant Field Values
-
COMPARATOR
-
-
Constructor Details
-
Suggest
public Suggest(<Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>> suggestions) -
Suggest
- Throws:
-
-
Method Details
-
iterator
public <Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>> iterator()- Specified by:
in interface
<Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>>
-
size
public int size()The number of suggestions in thisSuggest
result -
getSuggestion
public <T extends Suggest.Suggestion<? extends Suggest.Suggestion.Entry<? extends Suggest.Suggestion.Entry.Option>>> T getSuggestion( name) -
hasScoreDocs
public boolean hasScoreDocs()Whether any suggestions had query hits -
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput. -
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
-
fromXContent
this parsing method assumes that the leading "suggest" field name has already been parsed by the caller- Throws:
-
reduce
public static <<,<Suggest.Suggestion>> groupedSuggestions) -
filter
public <T extends <T> filter(<T> suggestionType)- Returns:
- only suggestions of type
suggestionType
contained in thisSuggest
instance
-
equals
public boolean equals( other)- Overrides:
in class
-
hashCode
public int hashCode()- Overrides:
in class
-
toString
public toString()- Overrides:
in class
-