Package org.apache.lucene.search.suggest
Class DocumentDictionary
java.lang.Object
org.apache.lucene.search.suggest.DocumentDictionary
- All Implemented Interfaces:
Dictionary
- Direct Known Subclasses:
DocumentValueSourceDictionary
Dictionary with terms, weights and optionally payload 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
NumericDocValues. If the weight field is not defined, the value of the weight is0 - 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
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentDictionary(IndexReader reader, String field, String weightField) Creates a new dictionary with the contents of the fields namedfieldfor the terms andweightFieldfor the weights that will be used for the corresponding terms.DocumentDictionary(IndexReader reader, String field, String weightField, String payloadField) Creates a new dictionary with the contents of the fields namedfieldfor the terms,weightFieldfor the weights that will be used for the the corresponding terms andpayloadFieldfor the corresponding payloads for the entry. -
Method Summary
Modifier and TypeMethodDescriptionReturns an iterator over all the entries
-
Constructor Details
-
DocumentDictionary
Creates a new dictionary with the contents of the fields namedfieldfor the terms andweightFieldfor the weights that will be used for the corresponding terms. -
DocumentDictionary
public DocumentDictionary(IndexReader reader, String field, String weightField, String payloadField) Creates a new dictionary with the contents of the fields namedfieldfor the terms,weightFieldfor the weights that will be used for the the corresponding terms andpayloadFieldfor the corresponding payloads for the entry.
-
-
Method Details
-
getEntryIterator
Description copied from interface:DictionaryReturns an iterator over all the entries- Specified by:
getEntryIteratorin interfaceDictionary- Returns:
- Iterator
- Throws:
IOException
-