public class CompletionSuggestionFuzzyBuilder extends SuggestBuilder.SuggestionBuilder<CompletionSuggestionFuzzyBuilder>
CompletionSuggestionBuilder
that supports fuzzy queries allowing
matches on typos.
Various settings control when and how fuzziness is counted.ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
EMPTY_PARAMS
Constructor and Description |
---|
CompletionSuggestionFuzzyBuilder(String name) |
Modifier and Type | Method and Description |
---|---|
Fuzziness |
getFuzziness() |
int |
getFuzzyMinLength() |
int |
getFuzzyPrefixLength() |
protected XContentBuilder |
innerToXContent(XContentBuilder builder,
ToXContent.Params params) |
boolean |
isFuzzyTranspositions() |
boolean |
isUnicodeAware() |
CompletionSuggestionFuzzyBuilder |
setFuzziness(Fuzziness fuzziness)
Sets the level of fuzziness used to create suggestions using a
Fuzziness instance. |
CompletionSuggestionFuzzyBuilder |
setFuzzyMinLength(int fuzzyMinLength)
Sets the minimum length of input string before fuzzy suggestions are returned, defaulting
to 3.
|
CompletionSuggestionFuzzyBuilder |
setFuzzyPrefixLength(int fuzzyPrefixLength)
Sets the minimum length of the input, which is not checked for fuzzy alternatives, defaults to 1
|
CompletionSuggestionFuzzyBuilder |
setFuzzyTranspositions(boolean fuzzyTranspositions)
Sets if transpositions (swapping one character for another) counts as one character
change or two.
|
CompletionSuggestionFuzzyBuilder |
setUnicodeAware(boolean unicodeAware)
Set to true if all measurements (like edit distance, transpositions and lengths) are in unicode
code points (actual letters) instead of bytes.
|
addCategory, addCategory, addContextField, addContextField, addGeoLocation, addGeoLocation, addGeoLocationWithPrecision, analyzer, field, shardSize, size, text, toXContent
buildAsBytes, buildAsBytes, toString
public CompletionSuggestionFuzzyBuilder(String name)
public Fuzziness getFuzziness()
public CompletionSuggestionFuzzyBuilder setFuzziness(Fuzziness fuzziness)
Fuzziness
instance.
The default value is Fuzziness.ONE
which allows for an "edit distance" of one.public boolean isFuzzyTranspositions()
public CompletionSuggestionFuzzyBuilder setFuzzyTranspositions(boolean fuzzyTranspositions)
public int getFuzzyMinLength()
public CompletionSuggestionFuzzyBuilder setFuzzyMinLength(int fuzzyMinLength)
public int getFuzzyPrefixLength()
public CompletionSuggestionFuzzyBuilder setFuzzyPrefixLength(int fuzzyPrefixLength)
public boolean isUnicodeAware()
public CompletionSuggestionFuzzyBuilder setUnicodeAware(boolean unicodeAware)
protected XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
innerToXContent
in class SuggestBuilder.SuggestionBuilder<CompletionSuggestionFuzzyBuilder>
IOException
Copyright © 2009–2017. All rights reserved.