public abstract class NormsConsumer extends Object implements Closeable
The lifecycle is:
NormsFormat.normsConsumer(SegmentWriteState)
.
addNormsField(org.apache.lucene.index.FieldInfo, java.lang.Iterable<java.lang.Number>)
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,
Iterable<Number> values)
Writes normalization values for a field.
|
void |
merge(MergeState mergeState)
Merges in the fields from the readers in
mergeState . |
void |
mergeNormsField(FieldInfo fieldInfo,
MergeState mergeState,
List<NumericDocValues> toMerge)
Merges the norms from
toMerge . |
protected NormsConsumer()
public abstract void addNormsField(FieldInfo field, Iterable<Number> values) throws IOException
field
- field informationvalues
- Iterable of numeric values (one for each document).IOException
- 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, java.util.List<org.apache.lucene.index.NumericDocValues>)
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 fieldInfo, MergeState mergeState, List<NumericDocValues> toMerge) throws IOException
toMerge
.
The default implementation calls addNormsField(org.apache.lucene.index.FieldInfo, java.lang.Iterable<java.lang.Number>)
, passing
an Iterable that merges and filters deleted documents on the fly.
IOException
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.