Class TermSuggesterDescriptor<T>
The term suggester suggests terms based on edit distance. The provided suggest text is analyzed before terms are suggested.
The suggested terms are provided per analyzed suggest text token.
The term suggester doesn’t take the query into account that is part of request.
Inheritance
TermSuggesterDescriptor<T>
Assembly: OpenSearch.Client.dll
Syntax
public class TermSuggesterDescriptor<T> : SuggestDescriptorBase<TermSuggesterDescriptor<T>, ITermSuggester, T>, IDescriptor, ITermSuggester, ISuggester where T : class
Type Parameters
Methods
|
Edit this page
View Source
LowercaseTerms(bool?)
Lower cases the suggest text terms after text analysis.
Declaration
public TermSuggesterDescriptor<T> LowercaseTerms(bool? lowercaseTerms = true)
Parameters
Type |
Name |
Description |
bool? |
lowercaseTerms |
|
Returns
|
Edit this page
View Source
MaxEdits(int?)
The maximum edit distance candidate suggestions can have in order to be considered as a suggestion.
Can only be a value between 1 and 2. Any other value result in an bad request error being thrown.
Defaults to 2.
Declaration
public TermSuggesterDescriptor<T> MaxEdits(int? maxEdits)
Parameters
Type |
Name |
Description |
int? |
maxEdits |
|
Returns
|
Edit this page
View Source
MaxInspections(int?)
A factor that is used to multiply with the shards_size in order to inspect more candidate spell
corrections on the shard level. Can improve accuracy at the cost of performance. Defaults to 5.
Declaration
public TermSuggesterDescriptor<T> MaxInspections(int? maxInspections)
Parameters
Type |
Name |
Description |
int? |
maxInspections |
|
Returns
|
Edit this page
View Source
MaxTermFrequency(float?)
The maximum threshold in number of documents a suggest text token can exist in order to be included.
Can be a relative percentage number (e.g 0.4) or an absolute number to represent document frequencies.
If an value higher than 1 is specified then fractional can not be specified. Defaults to 0.01f. This can be used to
exclude high frequency terms from being spellchecked. High frequency terms are usually spelled correctly on top of this
also improves the spellcheck performance. The shard level document frequencies are used for this option.
Declaration
public TermSuggesterDescriptor<T> MaxTermFrequency(float? frequency)
Parameters
Type |
Name |
Description |
float? |
frequency |
|
Returns
|
Edit this page
View Source
MinDocFrequency(float?)
The minimal threshold in number of documents a suggestion should appear in. This can be specified as an
absolute number or as a relative percentage of number of documents. This can improve quality by only
suggesting high frequency terms. Defaults to 0f and is not enabled. If a value higher than 1 is specified then the
number cannot be fractional. The shard level document frequencies are used for this option.
Declaration
public TermSuggesterDescriptor<T> MinDocFrequency(float? frequency)
Parameters
Type |
Name |
Description |
float? |
frequency |
|
Returns
|
Edit this page
View Source
MinWordLength(int?)
The minimum length a suggest text term must have in order to be included. Defaults to 4.
Declaration
public TermSuggesterDescriptor<T> MinWordLength(int? length)
Parameters
Type |
Name |
Description |
int? |
length |
|
Returns
|
Edit this page
View Source
PrefixLength(int?)
The number of minimal prefix characters that must match in order be a candidate suggestions. Defaults to 1.
Increasing this number improves spellcheck performance. Usually misspellings don’t occur in the
beginning of terms.
Declaration
public TermSuggesterDescriptor<T> PrefixLength(int? length)
Parameters
Type |
Name |
Description |
int? |
length |
|
Returns
|
Edit this page
View Source
ShardSize(int?)
Sets the maximum number of suggestions to be retrieved from each individual shard.
During the reduce phase only the top N suggestions are returned based on the size option.
Defaults to the size option. Setting this to a value higher than the size can be useful in order to
get a more accurate document frequency for spelling corrections at the cost of performance.
Due to the fact that terms are partitioned amongst shards, the shard level document frequencies of spelling corrections
may not be precise. Increasing this will make these document frequencies more precise.
Declaration
public TermSuggesterDescriptor<T> ShardSize(int? shardSize)
Parameters
Type |
Name |
Description |
int? |
shardSize |
|
Returns
|
Edit this page
View Source
Sort(SuggestSort?)
Defines how suggestions should be sorted per suggest text term
Declaration
public TermSuggesterDescriptor<T> Sort(SuggestSort? sort)
Parameters
Returns
|
Edit this page
View Source
StringDistance(StringDistance?)
Which string distance implementation to use for comparing how similar suggested terms are.
Declaration
public TermSuggesterDescriptor<T> StringDistance(StringDistance? distance)
Parameters
Returns
|
Edit this page
View Source
SuggestMode(SuggestMode?)
Controls what suggestions are included or controls for what suggest text terms, suggestions should be suggested.
Declaration
public TermSuggesterDescriptor<T> SuggestMode(SuggestMode? mode)
Parameters
Returns
|
Edit this page
View Source
Text(string)
Declaration
public TermSuggesterDescriptor<T> Text(string text)
Parameters
Type |
Name |
Description |
string |
text |
|
Returns
Implements
Extension Methods