Namespace Lucene.Net.Search.Suggest
Support for Autocomplete/Autosuggest
Classes
BufferedInputEnumerator
This wrapper buffers incoming elements.
Note
This API is experimental and might change in incompatible ways in the next release.
BufferingTermFreqEnumeratorWrapper
This wrapper buffers incoming elements.
Note
This API is experimental and might change in incompatible ways in the next release.
DocumentDictionary
Dictionary with terms, weights, payload (optional) and contexts (optional) information taken from stored/indexed fields in a Lucene index.
NOTE:- The term and (optionally) payload fields have to be stored
-
The weight field can be stored or can be a Lucene.Net.Index.NumericDocValues.
If the weight field is not defined, the value of the weight is
0
- if any of the term or (optionally) payload fields supplied do not have a value for a document, then the document is skipped by the dictionary
DocumentDictionary.DocumentInputEnumerator
Implements IInputEnumerator from stored fields.
DocumentValueSourceDictionary
Dictionary with terms and optionally payload information taken from stored fields in a Lucene index. Similar to DocumentDictionary, except it obtains the weight of the terms in a document based on a Lucene.Net.Queries.Function.ValueSource.
NOTE:- The term and (optionally) payload fields have to be stored
- if the term or (optionally) payload fields supplied do not have a value for a document, then the document is rejected by the dictionary
In practice the Lucene.Net.Queries.Function.ValueSource will likely be obtained using the lucene expression module. The following example shows how to create a Lucene.Net.Queries.Function.ValueSource from a simple addition of two fields:
Expression expression = JavascriptCompiler.Compile("f1 + f2");
SimpleBindings bindings = new SimpleBindings();
bindings.Add(new SortField("f1", SortField.Type_e.LONG));
bindings.Add(new SortField("f2", SortField.Type_e.LONG));
ValueSource valueSource = expression.GetValueSource(bindings);
FileDictionary
Dictionary represented by a text file.
Format allowed: 1 entry per line:
An entry can be:
- suggestion
- suggestion fieldDelimiter weight
- suggestion fieldDelimiter weight fieldDelimiter payload
NOTE:
- In order to have payload enabled, the first entry has to have a payload
- If the weight for an entry is not specified then a value of 1 is used
- A payload cannot be specified without having the weight specified for an entry
- If the payload for an entry is not specified (assuming payload is enabled) then an empty payload is returned
- An entry cannot have more than two fieldDelimiters
Example:
word1 word2 TAB 100 TAB payload1
word3 TAB 101
word4 word3 TAB 102
InMemorySorter
An IBytesRefSorter that keeps all the entries in memory.
Note
This API is experimental and might change in incompatible ways in the next release.
Note
This API is for internal purposes only and might change in incompatible ways in the next release.
InputEnumerator
Support for Autocomplete/Autosuggest
InputEnumeratorWrapper
Wraps a Lucene.Net.Util.IBytesRefEnumerator as a suggester IInputEnumerator, with all weights
set to 1
and carries no payload
Lookup
Simple Lookup interface for string suggestions.
Note
This API is experimental and might change in incompatible ways in the next release.
Lookup.LookupPriorityQueue
A Lucene.Net.Util.PriorityQueue<T> collecting a fixed size of high priority Lookup.LookupResults.
Lookup.LookupResult
Result of a lookup.
Note
This API is experimental and might change in incompatible ways in the next release.
SortedInputEnumerator
This wrapper buffers incoming elements and makes sure they are sorted based on given comparer.
Note
This API is experimental and might change in incompatible ways in the next release.
SortedTermFreqEnumeratorWrapper
This wrapper buffers incoming elements and makes sure they are sorted based on given comparer.
Note
This API is experimental and might change in incompatible ways in the next release.
UnsortedInputEnumerator
This wrapper buffers the incoming elements and makes sure they are in random order.
Note
This API is experimental and might change in incompatible ways in the next release.
Interfaces
IInputEnumerator
Interface for enumerating term,weight,payload triples for suggester consumption; currently only AnalyzingSuggester, FuzzySuggester and AnalyzingInfixSuggester support payloads.