public final class DirectCandidateGeneratorBuilder extends java.lang.Object implements PhraseSuggestionBuilder.CandidateGenerator
Writeable.Reader<V>, Writeable.Writer<V>
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
static ParseField |
ACCURACY_FIELD |
static ParseField |
DIRECT_GENERATOR_FIELD |
static ParseField |
FIELDNAME_FIELD |
static ParseField |
MAX_EDITS_FIELD |
static ParseField |
MAX_INSPECTIONS_FIELD |
static ParseField |
MAX_TERM_FREQ_FIELD |
static ParseField |
MIN_DOC_FREQ_FIELD |
static ParseField |
MIN_WORD_LENGTH_FIELD |
static ParseField |
POSTFILTER_FIELD |
static ParseField |
PREFILTER_FIELD |
static ParseField |
PREFIX_LENGTH_FIELD |
static ParseField |
SIZE_FIELD |
static ParseField |
SORT_FIELD |
static ParseField |
STRING_DISTANCE_FIELD |
static ParseField |
SUGGESTMODE_FIELD |
EMPTY_PARAMS
Constructor and Description |
---|
DirectCandidateGeneratorBuilder(StreamInput in)
Read from a stream.
|
DirectCandidateGeneratorBuilder(java.lang.String field) |
Modifier and Type | Method and Description |
---|---|
DirectCandidateGeneratorBuilder |
accuracy(float accuracy)
Sets how similar the suggested terms at least need to be compared to
the original suggest text tokens.
|
org.elasticsearch.search.suggest.phrase.PhraseSuggestionContext.DirectCandidateGenerator |
build(MapperService mapperService) |
boolean |
equals(java.lang.Object obj) |
static DirectCandidateGeneratorBuilder |
fromXContent(XContentParser parser) |
java.lang.String |
getType()
gets the type identifier of this
CandidateGenerator |
int |
hashCode() |
DirectCandidateGeneratorBuilder |
maxEdits(java.lang.Integer maxEdits)
Sets the maximum edit distance candidate suggestions can have in
order to be considered as a suggestion.
|
DirectCandidateGeneratorBuilder |
maxInspections(java.lang.Integer maxInspections)
A factor that is used to multiply with the size in order to inspect
more candidate suggestions.
|
DirectCandidateGeneratorBuilder |
maxTermFreq(float maxTermFreq)
Sets a maximum threshold in number of documents a suggest text token
can exist in order to be corrected.
|
DirectCandidateGeneratorBuilder |
minDocFreq(float minDocFreq)
Sets a minimal threshold in number of documents a suggested term
should appear in.
|
DirectCandidateGeneratorBuilder |
minWordLength(int minWordLength)
The minimum length a suggest text term must have in order to be
corrected.
|
DirectCandidateGeneratorBuilder |
postFilter(java.lang.String postFilter)
Sets a filter (analyzer) that is applied to each of the generated tokens
before they are passed to the actual phrase scorer.
|
DirectCandidateGeneratorBuilder |
preFilter(java.lang.String preFilter)
Sets a filter (analyzer) that is applied to each of the tokens passed to this candidate generator.
|
DirectCandidateGeneratorBuilder |
prefixLength(int prefixLength)
Sets the number of minimal prefix characters that must match in order
be a candidate suggestion.
|
DirectCandidateGeneratorBuilder |
size(int size)
Sets the maximum suggestions to be returned per suggest text term.
|
DirectCandidateGeneratorBuilder |
sort(java.lang.String sort)
Sets how to sort the suggest terms per suggest text token.
|
DirectCandidateGeneratorBuilder |
stringDistance(java.lang.String stringDistance)
Sets what string distance implementation to use for comparing how
similar suggested terms are.
|
DirectCandidateGeneratorBuilder |
suggestMode(java.lang.String suggestMode)
The global suggest mode controls what suggested terms are included or
controls for what suggest text tokens, terms should be suggested for.
|
java.lang.String |
toString() |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
void |
writeTo(StreamOutput out)
Write this into the StreamOutput.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isFragment
public static final ParseField DIRECT_GENERATOR_FIELD
public static final ParseField FIELDNAME_FIELD
public static final ParseField PREFILTER_FIELD
public static final ParseField POSTFILTER_FIELD
public static final ParseField SUGGESTMODE_FIELD
public static final ParseField MIN_DOC_FREQ_FIELD
public static final ParseField ACCURACY_FIELD
public static final ParseField SIZE_FIELD
public static final ParseField SORT_FIELD
public static final ParseField STRING_DISTANCE_FIELD
public static final ParseField MAX_EDITS_FIELD
public static final ParseField MAX_INSPECTIONS_FIELD
public static final ParseField MAX_TERM_FREQ_FIELD
public static final ParseField PREFIX_LENGTH_FIELD
public static final ParseField MIN_WORD_LENGTH_FIELD
public DirectCandidateGeneratorBuilder(java.lang.String field)
field
- Sets from what field to fetch the candidate suggestions from.public DirectCandidateGeneratorBuilder(StreamInput in) throws java.io.IOException
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Writeable
public DirectCandidateGeneratorBuilder suggestMode(java.lang.String suggestMode)
missing
- Only suggest terms in the suggest text
that aren't in the index. This is the default.
popular
- Only suggest terms that occur in more docs
then the original suggest text term.
always
- Suggest any matching suggest terms based on
tokens in the suggest text.
public DirectCandidateGeneratorBuilder accuracy(float accuracy)
Default is 0.5
public DirectCandidateGeneratorBuilder size(int size)
public DirectCandidateGeneratorBuilder sort(java.lang.String sort)
score
- Sort should first be based on score, then
document frequency and then the term itself.
frequency
- Sort should first be based on document
frequency, then score and then the term itself.
What the score is depends on the suggester being used.
public DirectCandidateGeneratorBuilder stringDistance(java.lang.String stringDistance)
internal
- This is the default and is based on
damerau_levenshtein
, but highly optimized for comparing
string distance for terms inside the index.
damerau_levenshtein
- String distance algorithm
based on Damerau-Levenshtein algorithm.
levenstein
- String distance algorithm based on
Levenstein edit distance algorithm.
jarowinkler
- String distance algorithm based on
Jaro-Winkler algorithm.
ngram
- String distance algorithm based on character
n-grams.
public DirectCandidateGeneratorBuilder maxEdits(java.lang.Integer maxEdits)
public DirectCandidateGeneratorBuilder maxInspections(java.lang.Integer maxInspections)
public DirectCandidateGeneratorBuilder maxTermFreq(float maxTermFreq)
This can be used to exclude high frequency terms from being suggested. High frequency terms are usually spelled correctly on top of this this also improves the suggest performance.
public DirectCandidateGeneratorBuilder prefixLength(int prefixLength)
public DirectCandidateGeneratorBuilder minWordLength(int minWordLength)
public DirectCandidateGeneratorBuilder minDocFreq(float minDocFreq)
public DirectCandidateGeneratorBuilder preFilter(java.lang.String preFilter)
public DirectCandidateGeneratorBuilder postFilter(java.lang.String postFilter)
public java.lang.String getType()
CandidateGenerator
getType
in interface PhraseSuggestionBuilder.CandidateGenerator
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
java.io.IOException
public static DirectCandidateGeneratorBuilder fromXContent(XContentParser parser) throws java.io.IOException
java.io.IOException
public org.elasticsearch.search.suggest.phrase.PhraseSuggestionContext.DirectCandidateGenerator build(MapperService mapperService) throws java.io.IOException
build
in interface PhraseSuggestionBuilder.CandidateGenerator
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object