Module org.apache.lucene.core
Class PerFieldDocValuesFormat.FieldsWriter
java.lang.Object
org.apache.lucene.codecs.DocValuesConsumer
org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat.FieldsWriter
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Enclosing class:
- PerFieldDocValuesFormat
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<DocValuesFormat,
PerFieldDocValuesFormat.ConsumerAndSuffix> private final SegmentWriteState
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBinaryField
(FieldInfo field, DocValuesProducer valuesProducer) Writes binary docvalues for a field.void
addNumericField
(FieldInfo field, DocValuesProducer valuesProducer) Writes numeric docvalues for a field.void
addSortedField
(FieldInfo field, DocValuesProducer valuesProducer) Writes pre-sorted binary docvalues for a field.void
addSortedNumericField
(FieldInfo field, DocValuesProducer valuesProducer) Writes pre-sorted numeric docvalues for a fieldvoid
addSortedSetField
(FieldInfo field, DocValuesProducer valuesProducer) Writes pre-sorted set docvalues for a fieldvoid
close()
private DocValuesConsumer
getInstance
(FieldInfo field) private DocValuesConsumer
getInstance
(FieldInfo field, boolean ignoreCurrentFormat) DocValuesConsumer for the given field.void
merge
(MergeState mergeState) Merges in the fields from the readers inmergeState
.Methods inherited from class org.apache.lucene.codecs.DocValuesConsumer
isSingleValued, mergeBinaryField, mergeNumericField, mergeSortedField, mergeSortedNumericField, mergeSortedSetField, singletonView
-
Field Details
-
formats
-
suffixes
-
segmentWriteState
-
-
Constructor Details
-
FieldsWriter
-
-
Method Details
-
addNumericField
Description copied from class:DocValuesConsumer
Writes numeric docvalues for a field.- Specified by:
addNumericField
in classDocValuesConsumer
- Parameters:
field
- field informationvaluesProducer
- Numeric values to write.- Throws:
IOException
- if an I/O error occurred.
-
addBinaryField
Description copied from class:DocValuesConsumer
Writes binary docvalues for a field.- Specified by:
addBinaryField
in classDocValuesConsumer
- Parameters:
field
- field informationvaluesProducer
- Binary values to write.- Throws:
IOException
- if an I/O error occurred.
-
addSortedField
Description copied from class:DocValuesConsumer
Writes pre-sorted binary docvalues for a field.- Specified by:
addSortedField
in classDocValuesConsumer
- Parameters:
field
- field informationvaluesProducer
- produces the values and ordinals to write- Throws:
IOException
- if an I/O error occurred.
-
addSortedNumericField
public void addSortedNumericField(FieldInfo field, DocValuesProducer valuesProducer) throws IOException Description copied from class:DocValuesConsumer
Writes pre-sorted numeric docvalues for a field- Specified by:
addSortedNumericField
in classDocValuesConsumer
- Parameters:
field
- field informationvaluesProducer
- produces the values to write- Throws:
IOException
- if an I/O error occurred.
-
addSortedSetField
Description copied from class:DocValuesConsumer
Writes pre-sorted set docvalues for a field- Specified by:
addSortedSetField
in classDocValuesConsumer
- Parameters:
field
- field informationvaluesProducer
- produces the values to write- Throws:
IOException
- if an I/O error occurred.
-
merge
Description copied from class:DocValuesConsumer
Merges in the fields from the readers inmergeState
. The default implementation callsDocValuesConsumer.mergeNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)
,DocValuesConsumer.mergeBinaryField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)
,DocValuesConsumer.mergeSortedField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)
,DocValuesConsumer.mergeSortedSetField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)
, orDocValuesConsumer.mergeSortedNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)
for each field, depending on its type. Implementations can override this method for more sophisticated merging (bulk-byte copying, etc).- Overrides:
merge
in classDocValuesConsumer
- Throws:
IOException
-
getInstance
- Throws:
IOException
-
getInstance
private DocValuesConsumer getInstance(FieldInfo field, boolean ignoreCurrentFormat) throws IOException DocValuesConsumer for the given field.- Parameters:
field
- - FieldInfo object.ignoreCurrentFormat
- - ignore the existing format attributes.- Returns:
- DocValuesConsumer for the field.
- Throws:
IOException
- if there is a low-level IO error
-
close
- Throws:
IOException
-