public class DocumentDictionary extends Object implements Dictionary
Dictionary with terms, weights, payload (optional) and contexts (optional) information taken from stored/indexed fields in a Lucene index.
NOTE:NumericDocValues
.
If the weight field is not defined, the value of the weight is 0
Modifier and Type | Class and Description |
---|---|
protected class |
DocumentDictionary.DocumentInputIterator
Implements
InputIterator from stored fields. |
Modifier and Type | Field and Description |
---|---|
protected String |
contextsField
Field to read contexts from
|
protected String |
payloadField
Field to read payload from
|
protected IndexReader |
reader
IndexReader to load documents from |
Constructor and Description |
---|
DocumentDictionary(IndexReader reader,
String field,
String weightField)
Creates a new dictionary with the contents of the fields named
field
for the terms and weightField for 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 named
field
for the terms, weightField for the weights that will be used for the
the corresponding terms and payloadField for the corresponding payloads
for the entry. |
DocumentDictionary(IndexReader reader,
String field,
String weightField,
String payloadField,
String contextsField)
Creates a new dictionary with the contents of the fields named
field
for the terms, weightField for the weights that will be used for the
the corresponding terms, payloadField for the corresponding payloads
for the entry and contextsField for associated contexts. |
Modifier and Type | Method and Description |
---|---|
InputIterator |
getEntryIterator()
Returns an iterator over all the entries
|
protected final IndexReader reader
IndexReader
to load documents fromprotected final String payloadField
protected final String contextsField
public DocumentDictionary(IndexReader reader, String field, String weightField)
field
for the terms and weightField
for the weights that will be used for
the corresponding terms.public DocumentDictionary(IndexReader reader, String field, String weightField, String payloadField)
field
for the terms, weightField
for the weights that will be used for the
the corresponding terms and payloadField
for the corresponding payloads
for the entry.public DocumentDictionary(IndexReader reader, String field, String weightField, String payloadField, String contextsField)
field
for the terms, weightField
for the weights that will be used for the
the corresponding terms, payloadField
for the corresponding payloads
for the entry and contextsField
for associated contexts.public InputIterator getEntryIterator() throws IOException
Dictionary
getEntryIterator
in interface Dictionary
IOException
Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.