Class DirectGenerator.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<DirectGenerator.Builder>
co.elastic.clients.elasticsearch.core.search.DirectGenerator.Builder
- All Implemented Interfaces:
WithJson<DirectGenerator.Builder>
,ObjectBuilder<DirectGenerator>
- Enclosing class:
- DirectGenerator
public static class DirectGenerator.Builder
extends WithJsonObjectBuilderBase<DirectGenerator.Builder>
implements ObjectBuilder<DirectGenerator>
Builder for
DirectGenerator
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aDirectGenerator
.final DirectGenerator.Builder
Required - The field to fetch the candidate suggestions from.final DirectGenerator.Builder
The maximum edit distance candidate suggestions can have in order to be considered as a suggestion.final DirectGenerator.Builder
maxInspections
(Float value) A factor that is used to multiply with the shard_size in order to inspect more candidate spelling corrections on the shard level.final DirectGenerator.Builder
maxTermFreq
(Float value) The maximum threshold in number of documents in which a suggest text token can exist in order to be included.final DirectGenerator.Builder
minDocFreq
(Float value) The minimal threshold in number of documents a suggestion should appear in.final DirectGenerator.Builder
minWordLength
(Integer value) The minimum length a suggest text term must have in order to be included.final DirectGenerator.Builder
postFilter
(String value) A filter (analyzer) that is applied to each of the generated tokens before they are passed to the actual phrase scorer.final DirectGenerator.Builder
A filter (analyzer) that is applied to each of the tokens passed to this candidate generator.final DirectGenerator.Builder
prefixLength
(Integer value) The number of minimal prefix characters that must match in order be a candidate suggestions.protected DirectGenerator.Builder
self()
final DirectGenerator.Builder
The maximum corrections to be returned per suggest text token.final DirectGenerator.Builder
suggestMode
(SuggestMode value) Controls what suggestions are included on the suggestions generated on each shard.Methods inherited from class co.elastic.clients.util.WithJsonObjectBuilderBase
withJson
Methods inherited from class co.elastic.clients.util.ObjectBuilderBase
_checkSingleUse, _listAdd, _listAddAll, _mapPut, _mapPutAll
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
field
Required - The field to fetch the candidate suggestions from. Needs to be set globally or per suggestion.API name:
field
-
maxEdits
The maximum edit distance candidate suggestions can have in order to be considered as a suggestion. Can only be1
or2
.API name:
max_edits
-
maxInspections
A factor that is used to multiply with the shard_size in order to inspect more candidate spelling corrections on the shard level. Can improve accuracy at the cost of performance.API name:
max_inspections
-
maxTermFreq
The maximum threshold in number of documents in which a suggest text token can exist in order to be included. This can be used to exclude high frequency terms — which are usually spelled correctly — from being spellchecked. Can be a relative percentage number (for example0.4
) or an absolute number to represent document frequencies. If a value higher than 1 is specified, then fractional can not be specified.API name:
max_term_freq
-
minDocFreq
The minimal threshold in number of documents a suggestion should appear in. This can improve quality by only suggesting high frequency terms. Can be specified as an absolute number or as a relative percentage of number of documents. If a value higher than 1 is specified, the number cannot be fractional.API name:
min_doc_freq
-
minWordLength
The minimum length a suggest text term must have in order to be included.API name:
min_word_length
-
postFilter
A filter (analyzer) that is applied to each of the generated tokens before they are passed to the actual phrase scorer.API name:
post_filter
-
preFilter
A filter (analyzer) that is applied to each of the tokens passed to this candidate generator. This filter is applied to the original token before candidates are generated.API name:
pre_filter
-
prefixLength
The number of minimal prefix characters that must match in order be a candidate suggestions. Increasing this number improves spellcheck performance.API name:
prefix_length
-
size
The maximum corrections to be returned per suggest text token.API name:
size
-
suggestMode
Controls what suggestions are included on the suggestions generated on each shard.API name:
suggest_mode
-
self
- Specified by:
self
in classWithJsonObjectBuilderBase<DirectGenerator.Builder>
-
build
Builds aDirectGenerator
.- Specified by:
build
in interfaceObjectBuilder<DirectGenerator>
- Throws:
NullPointerException
- if some of the required fields are null.
-