Class FSTCompletion
Finite state automata based implementation of "autocomplete" functionality.
Inherited Members
Namespace: Lucene.Net.Search.Suggest.Fst
Assembly: Lucene.Net.Suggest.dll
Syntax
public class FSTCompletion
Constructors
FSTCompletion(FST<object>)
Defaults to higher weights first and exact first.
Declaration
public FSTCompletion(FST<object> automaton)
Parameters
Type | Name | Description |
---|---|---|
FST<object> | automaton |
See Also
FSTCompletion(FST<object>, bool, bool)
Constructs an FSTCompletion, specifying higherWeightsFirst and exactFirst.
Declaration
public FSTCompletion(FST<object> automaton, bool higherWeightsFirst, bool exactFirst)
Parameters
Type | Name | Description |
---|---|---|
FST<object> | automaton | Automaton with completions. See FSTCompletionBuilder. |
bool | higherWeightsFirst | Return most popular suggestions first. This is the default
behavior for this implementation. Setting it to |
bool | exactFirst | Find and push an exact match to the first position of the result list if found. |
See Also
Fields
DEFAULT_BUCKETS
Default number of buckets.
Declaration
public const int DEFAULT_BUCKETS = 10
Field Value
Type | Description |
---|---|
int |
See Also
Properties
BucketCount
Returns the bucket count (discretization thresholds).
Declaration
public virtual int BucketCount { get; }
Property Value
Type | Description |
---|---|
int |
See Also
FST
Returns the internal automaton.
Declaration
public virtual FST<object> FST { get; }
Property Value
Type | Description |
---|---|
FST<object> |
See Also
Methods
DoLookup(string, int)
Lookup suggestions to key
.
Declaration
public virtual IList<FSTCompletion.Completion> DoLookup(string key, int num)
Parameters
Type | Name | Description |
---|---|---|
string | key | The prefix to which suggestions should be sought. |
int | num | At most this number of suggestions will be returned. |
Returns
Type | Description |
---|---|
IList<FSTCompletion.Completion> | Returns the suggestions, sorted by their approximated weight first (decreasing) and then alphabetically (UTF-8 codepoint order). |
See Also
GetBucket(string)
Returns the bucket assigned to a given key (if found) or -1
if
no exact match exists.
Declaration
public virtual int GetBucket(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key |
Returns
Type | Description |
---|---|
int |