public class SuggestBuilder extends ToXContentToBytes
TermSuggestionBuilder
instances.
Suggesting works by suggesting terms that appear in the suggest text that are similar compared to the terms in provided text. These spelling suggestions are based on several options described in this class.
Modifier and Type | Class and Description |
---|---|
static class |
SuggestBuilder.SuggestionBuilder<T> |
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
SuggestBuilder() |
SuggestBuilder(String name) |
Modifier and Type | Method and Description |
---|---|
SuggestBuilder |
addSuggestion(SuggestBuilder.SuggestionBuilder<?> suggestion)
Adds an
TermSuggestionBuilder instance under a user defined name. |
List<SuggestBuilder.SuggestionBuilder<?>> |
getSuggestion()
Returns all suggestions with the defined names.
|
SuggestBuilder |
setText(String globalText)
Sets the text to provide suggestions for.
|
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
buildAsBytes, buildAsBytes, toString
public SuggestBuilder()
public SuggestBuilder(String name)
public SuggestBuilder setText(String globalText)
setText(String)
method.
The suggest text gets analyzed by the suggest analyzer or the suggest field search analyzer. For each analyzed token, suggested terms are suggested if possible.
public SuggestBuilder addSuggestion(SuggestBuilder.SuggestionBuilder<?> suggestion)
TermSuggestionBuilder
instance under a user defined name.
The order in which the Suggestions
are added, is the same as in the response.public List<SuggestBuilder.SuggestionBuilder<?>> getSuggestion()
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
IOException
Copyright © 2009–2017. All rights reserved.