Class CompletionSuggester.Builder
java.lang.Object
co.elastic.clients.util.ObjectBuilderBase
co.elastic.clients.util.WithJsonObjectBuilderBase<BuilderT>
co.elastic.clients.elasticsearch.core.search.SuggesterBase.AbstractBuilder<CompletionSuggester.Builder>
co.elastic.clients.elasticsearch.core.search.CompletionSuggester.Builder
- All Implemented Interfaces:
WithJson<CompletionSuggester.Builder>
,ObjectBuilder<CompletionSuggester>
- Enclosing class:
- CompletionSuggester
public static class CompletionSuggester.Builder
extends SuggesterBase.AbstractBuilder<CompletionSuggester.Builder>
implements ObjectBuilder<CompletionSuggester>
Builder for
CompletionSuggester
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds aCompletionSuggester
.contexts
(String key, List<CompletionContext> value) A value, geo point object, or a geo hash string to filter or boost the suggestion on.contexts
(Map<String, List<CompletionContext>> map) A value, geo point object, or a geo hash string to filter or boost the suggestion on.fuzzy
(SuggestFuzziness value) Enables fuzziness, meaning you can have a typo in your search and still get results back.Enables fuzziness, meaning you can have a typo in your search and still get results back.regex
(RegexOptions value) A regex query that expresses a prefix as a regular expression.A regex query that expresses a prefix as a regular expression.protected CompletionSuggester.Builder
self()
skipDuplicates
(Boolean value) Whether duplicate suggestions should be filtered out.Methods inherited from class co.elastic.clients.elasticsearch.core.search.SuggesterBase.AbstractBuilder
analyzer, field, size
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
-
contexts
A value, geo point object, or a geo hash string to filter or boost the suggestion on.API name:
contexts
Adds all entries of
map
tocontexts
. -
contexts
A value, geo point object, or a geo hash string to filter or boost the suggestion on.API name:
contexts
Adds an entry to
contexts
. -
fuzzy
Enables fuzziness, meaning you can have a typo in your search and still get results back.API name:
fuzzy
-
fuzzy
public final CompletionSuggester.Builder fuzzy(Function<SuggestFuzziness.Builder, ObjectBuilder<SuggestFuzziness>> fn) Enables fuzziness, meaning you can have a typo in your search and still get results back.API name:
fuzzy
-
regex
A regex query that expresses a prefix as a regular expression.API name:
regex
-
regex
public final CompletionSuggester.Builder regex(Function<RegexOptions.Builder, ObjectBuilder<RegexOptions>> fn) A regex query that expresses a prefix as a regular expression.API name:
regex
-
skipDuplicates
Whether duplicate suggestions should be filtered out.API name:
skip_duplicates
-
self
- Specified by:
self
in classSuggesterBase.AbstractBuilder<CompletionSuggester.Builder>
-
build
Builds aCompletionSuggester
.- Specified by:
build
in interfaceObjectBuilder<CompletionSuggester>
- Throws:
NullPointerException
- if some of the required fields are null.
-