Class PhraseSuggester.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch.core.search.SuggesterBase.AbstractBuilder<PhraseSuggester.Builder>
co.elastic.clients.elasticsearch.core.search.PhraseSuggester.Builder
- All Implemented Interfaces:
WithJson<PhraseSuggester.Builder>,ObjectBuilder<PhraseSuggester>
- Enclosing class:
- PhraseSuggester
public static class PhraseSuggester.Builder
extends SuggesterBase.AbstractBuilder<PhraseSuggester.Builder>
implements ObjectBuilder<PhraseSuggester>
Builder for
PhraseSuggester.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aPhraseSuggester.final PhraseSuggester.Buildercollate(PhraseSuggestCollate value) Checks each suggestion against the specified query to prune suggestions for which no matching docs exist in the index.final PhraseSuggester.BuilderChecks each suggestion against the specified query to prune suggestions for which no matching docs exist in the index.final PhraseSuggester.Builderconfidence(Double value) Defines a factor applied to the input phrases score, which is used as a threshold for other suggest candidates.final PhraseSuggester.BuilderdirectGenerator(DirectGenerator value, DirectGenerator... values) A list of candidate generators that produce a list of possible terms per term in the given text.final PhraseSuggester.BuilderA list of candidate generators that produce a list of possible terms per term in the given text.final PhraseSuggester.BuilderdirectGenerator(List<DirectGenerator> list) A list of candidate generators that produce a list of possible terms per term in the given text.final PhraseSuggester.BuilderforceUnigrams(Boolean value) API name:force_unigramsfinal PhraseSuggester.BuilderSets max size of the n-grams (shingles) in the field.final PhraseSuggester.Builderhighlight(PhraseSuggestHighlight value) Sets up suggestion highlighting.final PhraseSuggester.BuilderSets up suggestion highlighting.final PhraseSuggester.BuilderThe maximum percentage of the terms considered to be misspellings in order to form a correction.final PhraseSuggester.BuilderrealWordErrorLikelihood(Double value) The likelihood of a term being misspelled even if the term exists in the dictionary.protected PhraseSuggester.Builderself()final PhraseSuggester.BuilderThe separator that is used to separate terms in the bigram field.final PhraseSuggester.BuilderSets the maximum number of suggested terms to be retrieved from each individual shard.final PhraseSuggester.Buildersmoothing(SmoothingModel value) The smoothing model used to balance weight between infrequent grams (grams (shingles) are not existing in the index) and frequent grams (appear at least once in the index).final PhraseSuggester.BuilderThe smoothing model used to balance weight between infrequent grams (grams (shingles) are not existing in the index) and frequent grams (appear at least once in the index).final PhraseSuggester.BuilderThe text/query to provide suggestions for.final PhraseSuggester.BuildertokenLimit(Integer value) API name:token_limitMethods inherited from class co.elastic.clients.elasticsearch.core.search.SuggesterBase.AbstractBuilder
analyzer, field, sizeMethods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJsonMethods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
collate
Checks each suggestion against the specified query to prune suggestions for which no matching docs exist in the index.API name:
collate -
collate
public final PhraseSuggester.Builder collate(Function<PhraseSuggestCollate.Builder, ObjectBuilder<PhraseSuggestCollate>> fn) Checks each suggestion against the specified query to prune suggestions for which no matching docs exist in the index.API name:
collate -
confidence
Defines a factor applied to the input phrases score, which is used as a threshold for other suggest candidates. Only candidates that score higher than the threshold will be included in the result.API name:
confidence -
directGenerator
A list of candidate generators that produce a list of possible terms per term in the given text.API name:
direct_generatorAdds all elements of
listtodirectGenerator. -
directGenerator
public final PhraseSuggester.Builder directGenerator(DirectGenerator value, DirectGenerator... values) A list of candidate generators that produce a list of possible terms per term in the given text.API name:
direct_generatorAdds one or more values to
directGenerator. -
directGenerator
public final PhraseSuggester.Builder directGenerator(Function<DirectGenerator.Builder, ObjectBuilder<DirectGenerator>> fn) A list of candidate generators that produce a list of possible terms per term in the given text.API name:
direct_generatorAdds a value to
directGeneratorusing a builder lambda. -
forceUnigrams
API name:force_unigrams -
gramSize
Sets max size of the n-grams (shingles) in the field. If the field doesn’t contain n-grams (shingles), this should be omitted or set to1. If the field uses a shingle filter, thegram_sizeis set to themax_shingle_sizeif not explicitly set.API name:
gram_size -
highlight
Sets up suggestion highlighting. If not provided, no highlighted field is returned.API name:
highlight -
highlight
public final PhraseSuggester.Builder highlight(Function<PhraseSuggestHighlight.Builder, ObjectBuilder<PhraseSuggestHighlight>> fn) Sets up suggestion highlighting. If not provided, no highlighted field is returned.API name:
highlight -
maxErrors
The maximum percentage of the terms considered to be misspellings in order to form a correction. This method accepts a float value in the range[0..1)as a fraction of the actual query terms or a number>=1as an absolute number of query terms.API name:
max_errors -
realWordErrorLikelihood
The likelihood of a term being misspelled even if the term exists in the dictionary.API name:
real_word_error_likelihood -
separator
The separator that is used to separate terms in the bigram field. If not set, the whitespace character is used as a separator.API name:
separator -
shardSize
Sets the maximum number of suggested terms to be retrieved from each individual shard.API name:
shard_size -
smoothing
The smoothing model used to balance weight between infrequent grams (grams (shingles) are not existing in the index) and frequent grams (appear at least once in the index). The default model is Stupid Backoff.API name:
smoothing -
smoothing
public final PhraseSuggester.Builder smoothing(Function<SmoothingModel.Builder, ObjectBuilder<SmoothingModel>> fn) The smoothing model used to balance weight between infrequent grams (grams (shingles) are not existing in the index) and frequent grams (appear at least once in the index). The default model is Stupid Backoff.API name:
smoothing -
text
The text/query to provide suggestions for.API name:
text -
tokenLimit
API name:token_limit -
self
- Specified by:
selfin classSuggesterBase.AbstractBuilder<PhraseSuggester.Builder>
-
build
Builds aPhraseSuggester.- Specified by:
buildin interfaceObjectBuilder<PhraseSuggester>- Throws:
NullPointerException- if some of the required fields are null.
-