Class 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 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 ValueSource will likely be obtained using the lucene expression module. The following example shows how to create a 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);
Inherited Members
Assembly: Lucene.Net.Suggest.dll
Syntax
public class DocumentValueSourceDictionary : DocumentDictionary, IDictionary
Constructors
Name | Description |
---|---|
DocumentValueSourceDictionary(IndexReader, String, ValueSource) | Creates a new dictionary with the contents of the fields named |
DocumentValueSourceDictionary(IndexReader, String, ValueSource, String) | Creates a new dictionary with the contents of the fields named |
DocumentValueSourceDictionary(IndexReader, String, ValueSource, String, String) | Creates a new dictionary with the contents of the fields named |
Methods
Name | Description |
---|---|
GetEntryIterator() |