public class CompletionSuggestionBuilder extends SuggestionBuilder<CompletionSuggestionBuilder>
Modifier and Type | Class and Description |
---|---|
static class |
CompletionSuggestionBuilder.Contexts2x |
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
protected BytesReference |
contextBytes |
protected FuzzyOptions |
fuzzyOptions |
protected RegexOptions |
regexOptions |
analyzer, ANALYZER_FIELD, field, FIELDNAME_FIELD, prefix, PREFIX_FIELD, regex, REGEX_FIELD, shardSize, SHARDSIZE_FIELD, size, SIZE_FIELD, text, TEXT_FIELD
EMPTY_PARAMS
Constructor and Description |
---|
CompletionSuggestionBuilder(StreamInput in)
Read from a stream.
|
CompletionSuggestionBuilder(java.lang.String field) |
Modifier and Type | Method and Description |
---|---|
SuggestionSearchContext.SuggestionContext |
build(QueryShardContext context) |
CompletionSuggestionBuilder |
contexts(CompletionSuggestionBuilder.Contexts2x contexts2x) |
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 |
analyzer, analyzer, equals, field, hashCode, populateCommonFields, prefix, regex, shardSize, shardSize, size, size, text, text, toXContent, writeTo
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
isFragment
protected FuzzyOptions fuzzyOptions
protected RegexOptions regexOptions
protected BytesReference contextBytes
public CompletionSuggestionBuilder(java.lang.String field)
public CompletionSuggestionBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
public void doWriteTo(StreamOutput out) throws java.io.IOException
doWriteTo
in class SuggestionBuilder<CompletionSuggestionBuilder>
java.io.IOException
public 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 fuzziness
public CompletionSuggestionBuilder prefix(java.lang.String prefix, FuzzyOptions fuzzyOptions)
prefix(String)
with full fuzzy options
see FuzzyOptions.Builder
public 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.Builder
public CompletionSuggestionBuilder contexts(java.util.Map<java.lang.String,java.util.List<? extends ToXContent>> queryContexts)
queryContexts
- named query contexts
see CategoryQueryContext
and GeoQueryContext
public CompletionSuggestionBuilder contexts(CompletionSuggestionBuilder.Contexts2x contexts2x)
protected XContentBuilder innerToXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
innerToXContent
in class SuggestionBuilder<CompletionSuggestionBuilder>
java.io.IOException
public static CompletionSuggestionBuilder fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException
public SuggestionSearchContext.SuggestionContext build(QueryShardContext context) throws java.io.IOException
build
in class SuggestionBuilder<CompletionSuggestionBuilder>
java.io.IOException
public java.lang.String getWriteableName()
NamedWriteable
protected boolean doEquals(CompletionSuggestionBuilder other)
SuggestionBuilder
SuggestionBuilder
of the same type is "equal to" this one.doEquals
in class SuggestionBuilder<CompletionSuggestionBuilder>
protected int doHashCode()
SuggestionBuilder
SuggestionBuilder
to implement.doHashCode
in class SuggestionBuilder<CompletionSuggestionBuilder>