NormsConsumer

abstract class NormsConsumer : AutoCloseable

Abstract API that consumes normalization values. Concrete implementations of this actually do "something" with the norms (write it into the index in a specific format).

The lifecycle is:

  1. NormsConsumer is created by NormsFormat.normsConsumer.

  2. .addNormsField 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).

  3. After all fields are added, the consumer is .closed.

Functions

Link copied to clipboard
abstract fun addNormsField(field: FieldInfo, normsProducer: NormsProducer)

Writes normalization values for a field.

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard
fun merge(mergeState: MergeState)

Merges in the fields from the readers in mergeState. The default implementation calls .mergeNormsField 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).

Link copied to clipboard
fun mergeNormsField(mergeFieldInfo: FieldInfo, mergeState: MergeState)

Merges the norms from toMerge.