NamedWriteable, Writeable, ToXContent, ToXContentFragmentpublic class CompletionSuggestionBuilder extends SuggestionBuilder<CompletionSuggestionBuilder>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsWriteable.Reader<V>, Writeable.Writer<V>| Modifier and Type | Field | Description |
|---|---|---|
protected BytesReference |
contextBytes |
|
protected FuzzyOptions |
fuzzyOptions |
|
protected RegexOptions |
regexOptions |
|
protected boolean |
skipDuplicates |
analyzer, ANALYZER_FIELD, field, FIELDNAME_FIELD, prefix, PREFIX_FIELD, regex, REGEX_FIELD, shardSize, SHARDSIZE_FIELD, size, SIZE_FIELD, text, TEXT_FIELDEMPTY_PARAMS| Constructor | Description |
|---|---|
CompletionSuggestionBuilder(java.lang.String field) |
|
CompletionSuggestionBuilder(StreamInput in) |
Read from a stream.
|
| Modifier and Type | Method | Description |
|---|---|---|
SuggestionSearchContext.SuggestionContext |
build(QueryShardContext context) |
|
CompletionSuggestionBuilder |
contexts(java.util.Map<java.lang.String,java.util.List<? extends ToXContent>> queryContexts) |
Sets query contexts for completion
|
protected boolean |
doEquals(CompletionSuggestionBuilder other) |
Indicates whether some other
SuggestionBuilder of the same type is "equal to" this one. |
protected int |
doHashCode() |
HashCode for the subclass of
SuggestionBuilder to implement. |
void |
doWriteTo(StreamOutput out) |
|
static CompletionSuggestionBuilder |
fromXContent(XContentParser parser) |
|
java.lang.String |
getWriteableName() |
Returns the name of the writeable object
|
protected XContentBuilder |
innerToXContent(XContentBuilder builder,
ToXContent.Params params) |
|
CompletionSuggestionBuilder |
prefix(java.lang.String prefix) |
Sets the prefix to provide completions for.
|
CompletionSuggestionBuilder |
prefix(java.lang.String prefix,
Fuzziness fuzziness) |
Same as
prefix(String) with fuzziness of fuzziness |
CompletionSuggestionBuilder |
prefix(java.lang.String prefix,
FuzzyOptions fuzzyOptions) |
Same as
prefix(String) with full fuzzy options
see FuzzyOptions.Builder |
CompletionSuggestionBuilder |
regex(java.lang.String regex) |
Sets a regular expression pattern for prefixes to provide completions for.
|
CompletionSuggestionBuilder |
regex(java.lang.String regex,
RegexOptions regexOptions) |
Same as
regex(String) with full regular expression options
see RegexOptions.Builder |
boolean |
skipDuplicates() |
Returns whether duplicate suggestions should be filtered out.
|
CompletionSuggestionBuilder |
skipDuplicates(boolean skipDuplicates) |
Should duplicates be filtered or not.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitanalyzer, analyzer, equals, field, hashCode, populateCommonFields, prefix, regex, shardSize, shardSize, size, size, text, text, toXContent, writeToisFragmentprotected FuzzyOptions fuzzyOptions
protected RegexOptions regexOptions
protected BytesReference contextBytes
protected boolean skipDuplicates
public CompletionSuggestionBuilder(java.lang.String field)
public CompletionSuggestionBuilder(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo in class SuggestionBuilder<CompletionSuggestionBuilder>java.io.IOExceptionpublic CompletionSuggestionBuilder prefix(java.lang.String prefix)
prefix in class SuggestionBuilder<CompletionSuggestionBuilder>public CompletionSuggestionBuilder prefix(java.lang.String prefix, Fuzziness fuzziness)
prefix(String) with fuzziness of fuzzinesspublic CompletionSuggestionBuilder prefix(java.lang.String prefix, FuzzyOptions fuzzyOptions)
prefix(String) with full fuzzy options
see FuzzyOptions.Builderpublic CompletionSuggestionBuilder regex(java.lang.String regex)
regex in class SuggestionBuilder<CompletionSuggestionBuilder>public CompletionSuggestionBuilder regex(java.lang.String regex, RegexOptions regexOptions)
regex(String) with full regular expression options
see RegexOptions.Builderpublic CompletionSuggestionBuilder contexts(java.util.Map<java.lang.String,java.util.List<? extends ToXContent>> queryContexts)
queryContexts - named query contexts
see CategoryQueryContext
and GeoQueryContextpublic boolean skipDuplicates()
public CompletionSuggestionBuilder skipDuplicates(boolean skipDuplicates)
protected XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
innerToXContent in class SuggestionBuilder<CompletionSuggestionBuilder>java.io.IOExceptionpublic static CompletionSuggestionBuilder fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOExceptionpublic SuggestionSearchContext.SuggestionContext build(QueryShardContext context) throws java.io.IOException
build in class SuggestionBuilder<CompletionSuggestionBuilder>java.io.IOExceptionpublic java.lang.String getWriteableName()
NamedWriteableprotected boolean doEquals(CompletionSuggestionBuilder other)
SuggestionBuilderSuggestionBuilder of the same type is "equal to" this one.doEquals in class SuggestionBuilder<CompletionSuggestionBuilder>protected int doHashCode()
SuggestionBuilderSuggestionBuilder to implement.doHashCode in class SuggestionBuilder<CompletionSuggestionBuilder>