public abstract class NormsConsumer extends Object implements Closeable
The lifecycle is:
NormsFormat.normsConsumer(SegmentWriteState)
.
addNormsField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.NormsProducer)
is called for each field with
normalization values. 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 |
NormsConsumer()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addNormsField(FieldInfo field,
NormsProducer normsProducer)
Writes normalization values for a field.
|
void |
merge(MergeState mergeState)
Merges in the fields from the readers in
mergeState . |
void |
mergeNormsField(FieldInfo mergeFieldInfo,
MergeState mergeState)
Merges the norms from
toMerge . |
protected NormsConsumer()
public abstract void addNormsField(FieldInfo field, NormsProducer normsProducer) throws IOException
field
- field informationnormsProducer
- NormsProducer of the numeric norm valuesIOException
- if an I/O error occurred.public void merge(MergeState mergeState) throws IOException
mergeState
. The default implementation
calls mergeNormsField(org.apache.lucene.index.FieldInfo, org.apache.lucene.index.MergeState)
for each field,
filling segments with missing norms for the field with zeros.
Implementations can override this method
for more sophisticated merging (bulk-byte copying, etc).IOException
public void mergeNormsField(FieldInfo mergeFieldInfo, MergeState mergeState) throws IOException
toMerge
.
The default implementation calls addNormsField(org.apache.lucene.index.FieldInfo, org.apache.lucene.codecs.NormsProducer)
, passing
an Iterable that merges and filters deleted documents on the fly.
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.