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
public class DocumentDictionary extends java.lang.Object implements Dictionary
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
Constructors Constructor Description DocumentDictionary(IndexReader reader, java.lang.String field, java.lang.String weightField)
Creates a new dictionary with the contents of the fields namedfield
for the terms andweightField
for the weights that will be used for the corresponding terms.DocumentDictionary(IndexReader reader, java.lang.String field, java.lang.String weightField, java.lang.String payloadField)
Creates a new dictionary with the contents of the fields namedfield
for the terms,weightField
for the weights that will be used for the the corresponding terms andpayloadField
for the corresponding payloads for the entry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputIterator
getEntryIterator()
Returns an iterator over all the entries
-
-
-
Constructor Detail
-
DocumentDictionary
public DocumentDictionary(IndexReader reader, java.lang.String field, java.lang.String weightField)
Creates a new dictionary with the contents of the fields namedfield
for the terms andweightField
for the weights that will be used for the corresponding terms.
-
DocumentDictionary
public DocumentDictionary(IndexReader reader, java.lang.String field, java.lang.String weightField, java.lang.String payloadField)
Creates a new dictionary with the contents of the fields namedfield
for the terms,weightField
for the weights that will be used for the the corresponding terms andpayloadField
for the corresponding payloads for the entry.
-
-
Method Detail
-
getEntryIterator
public InputIterator getEntryIterator() throws java.io.IOException
Description copied from interface:Dictionary
Returns an iterator over all the entries- Specified by:
getEntryIterator
in interfaceDictionary
- Returns:
- Iterator
- Throws:
java.io.IOException
-
-