public abstract class DocValuesConsumer extends Object implements Closeable
The lifecycle is:
NormsFormat.normsConsumer(SegmentWriteState)
.
addNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer)
, addBinaryField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer)
,
addSortedField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer)
, addSortedSetField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer)
,
or addSortedNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer)
are called for each Numeric,
Binary, Sorted, SortedSet, or SortedNumeric docvalues field.
The API is a "pull" rather than "push", and the implementation
is free to iterate over the values multiple times
(Iterable.iterator()
).
Closeable.close()
d.
Modifier | Constructor and Description |
---|---|
protected |
DocValuesConsumer()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addBinaryField(FieldInfo field,
DocValuesProducer valuesProducer)
Writes binary docvalues for a field.
|
abstract void |
addNumericField(FieldInfo field,
DocValuesProducer valuesProducer)
Writes numeric docvalues for a field.
|
abstract void |
addSortedField(FieldInfo field,
DocValuesProducer valuesProducer)
Writes pre-sorted binary docvalues for a field.
|
abstract void |
addSortedNumericField(FieldInfo field,
DocValuesProducer valuesProducer)
Writes pre-sorted numeric docvalues for a field
|
abstract void |
addSortedSetField(FieldInfo field,
DocValuesProducer valuesProducer)
Writes pre-sorted set docvalues for a field
|
static boolean |
isSingleValued(Iterable<Number> docToValueCount)
Helper: returns true if the given docToValue count contains only at most one value
|
void |
merge(MergeState mergeState)
Merges in the fields from the readers in
mergeState . |
void |
mergeBinaryField(FieldInfo mergeFieldInfo,
MergeState mergeState)
Merges the binary docvalues from
MergeState . |
void |
mergeNumericField(FieldInfo mergeFieldInfo,
MergeState mergeState)
Merges the numeric docvalues from
MergeState . |
void |
mergeSortedField(FieldInfo fieldInfo,
MergeState mergeState)
Merges the sorted docvalues from
toMerge . |
void |
mergeSortedNumericField(FieldInfo mergeFieldInfo,
MergeState mergeState)
Merges the sorted docvalues from
toMerge . |
void |
mergeSortedSetField(FieldInfo mergeFieldInfo,
MergeState mergeState)
Merges the sortedset docvalues from
toMerge . |
static Iterable<Number> |
singletonView(Iterable<Number> docToValueCount,
Iterable<Number> values,
Number missingValue)
Helper: returns single-valued view, using
missingValue when count is zero |
protected DocValuesConsumer()
public abstract void addNumericField(FieldInfo field, DocValuesProducer valuesProducer) throws IOException
field
- field informationvaluesProducer
- Numeric values to write.IOException
- if an I/O error occurred.public abstract void addBinaryField(FieldInfo field, DocValuesProducer valuesProducer) throws IOException
field
- field informationvaluesProducer
- Binary values to write.IOException
- if an I/O error occurred.public abstract void addSortedField(FieldInfo field, DocValuesProducer valuesProducer) throws IOException
field
- field informationvaluesProducer
- produces the values and ordinals to writeIOException
- if an I/O error occurred.public abstract void addSortedNumericField(FieldInfo field, DocValuesProducer valuesProducer) throws IOException
field
- field informationvaluesProducer
- produces the values to writeIOException
- if an I/O error occurred.public abstract void addSortedSetField(FieldInfo field, DocValuesProducer valuesProducer) throws IOException
field
- field informationvaluesProducer
- produces the values to writeIOException
- if an I/O error occurred.public void merge(MergeState mergeState) throws IOException
mergeState
. The default implementation
calls mergeNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)
, mergeBinaryField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)
,
mergeSortedField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)
, mergeSortedSetField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)
,
or 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).IOException
public void mergeNumericField(FieldInfo mergeFieldInfo, MergeState mergeState) throws IOException
MergeState
.
The default implementation calls addNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer)
, passing
a DocValuesProducer that merges and filters deleted documents on the fly.
IOException
public void mergeBinaryField(FieldInfo mergeFieldInfo, MergeState mergeState) throws IOException
MergeState
.
The default implementation calls addBinaryField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer)
, passing
a DocValuesProducer that merges and filters deleted documents on the fly.
IOException
public void mergeSortedNumericField(FieldInfo mergeFieldInfo, MergeState mergeState) throws IOException
toMerge
.
The default implementation calls addSortedNumericField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer)
, passing
iterables that filter deleted documents.
IOException
public void mergeSortedField(FieldInfo fieldInfo, MergeState mergeState) throws IOException
toMerge
.
The default implementation calls addSortedField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer)
, passing
an Iterable that merges ordinals and values and filters deleted documents .
IOException
public void mergeSortedSetField(FieldInfo mergeFieldInfo, MergeState mergeState) throws IOException
toMerge
.
The default implementation calls addSortedSetField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.DocValuesProducer)
, passing
an Iterable that merges ordinals and values and filters deleted documents .
IOException
public static boolean isSingleValued(Iterable<Number> docToValueCount)
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.