Class PhraseSuggester
java.lang.Object
co.elastic.clients.elasticsearch.core.search.SuggesterBase
co.elastic.clients.elasticsearch.core.search.PhraseSuggester
- All Implemented Interfaces:
FieldSuggesterVariant
,JsonpSerializable
@JsonpDeserializable
public class PhraseSuggester
extends SuggesterBase
implements FieldSuggesterVariant
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class co.elastic.clients.elasticsearch.core.search.SuggesterBase
SuggesterBase.AbstractBuilder<BuilderT extends SuggesterBase.AbstractBuilder<BuilderT>>
-
Field Summary
Modifier and TypeFieldDescriptionstatic final JsonpDeserializer<PhraseSuggester>
Json deserializer forPhraseSuggester
-
Method Summary
Modifier and TypeMethodDescriptionFieldSuggester variant kind.final PhraseSuggestCollate
collate()
Checks each suggestion against the specified query to prune suggestions for which no matching docs exist in the index.final Double
Defines a factor applied to the input phrases score, which is used as a threshold for other suggest candidates.final List<DirectGenerator>
A list of candidate generators that produce a list of possible terms per term in the given text.final Boolean
API name:force_unigrams
final Integer
gramSize()
Sets max size of the n-grams (shingles) in the field.final PhraseSuggestHighlight
Sets up suggestion highlighting.final Double
The maximum percentage of the terms considered to be misspellings in order to form a correction.static PhraseSuggester
final Double
The likelihood of a term being misspelled even if the term exists in the dictionary.final String
The separator that is used to separate terms in the bigram field.protected void
serializeInternal
(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static void
final Integer
Sets the maximum number of suggested terms to be retrieved from each individual shard.final SmoothingModel
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 String
text()
The text/query to provide suggestions for.final Integer
API name:token_limit
Methods inherited from class co.elastic.clients.elasticsearch.core.search.SuggesterBase
analyzer, field, serialize, setupSuggesterBaseDeserializer, size, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface co.elastic.clients.elasticsearch.core.search.FieldSuggesterVariant
_toFieldSuggester
-
Field Details
-
_DESERIALIZER
Json deserializer forPhraseSuggester
-
-
Method Details
-
of
public static PhraseSuggester of(Function<PhraseSuggester.Builder, ObjectBuilder<PhraseSuggester>> fn) -
_fieldSuggesterKind
FieldSuggester variant kind.- Specified by:
_fieldSuggesterKind
in interfaceFieldSuggesterVariant
-
collate
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_generator
-
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_size
is set to themax_shingle_size
if not explicitly set.API name:
gram_size
-
highlight
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>=1
as 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
-
text
The text/query to provide suggestions for.API name:
text
-
tokenLimit
API name:token_limit
-
serializeInternal
- Overrides:
serializeInternal
in classSuggesterBase
-
setupPhraseSuggesterDeserializer
protected static void setupPhraseSuggesterDeserializer(ObjectDeserializer<PhraseSuggester.Builder> op)
-