PostingsWriterBase

Class that plugs into term dictionaries, such as Lucene90BlockTreeTermsWriter, and handles writing postings.

See also

Inheritors

Functions

Link copied to clipboard
abstract override fun close()
Link copied to clipboard
abstract fun encodeTerm(out: DataOutput, fieldInfo: FieldInfo, state: BlockTermState, absolute: Boolean)

Encode metadata as long[] and byte[]. absolute controls whether current term is delta encoded according to latest term. Usually elements in longs are file pointers, so each one always increases when a new term is consumed. out is used to write generic bytes, which are not monotonic.

Link copied to clipboard
abstract fun init(termsOut: IndexOutput, state: SegmentWriteState)

Called once after startup, before any terms have been added. Implementations typically write a header to the provided termsOut.

Link copied to clipboard
abstract fun setField(fieldInfo: FieldInfo)

Sets the current field for writing.

Link copied to clipboard
abstract fun writeTerm(term: BytesRef, termsEnum: TermsEnum, docsSeen: FixedBitSet, norms: NormsProducer?): BlockTermState?

Write all postings for one term; use the provided TermsEnum to pull a [ ]. This method should not re-position the TermsEnum! It is already positioned on the term that should be written. This method must set the bit in the provided FixedBitSet for every docID written. If no docs were written, this method should return null, and the terms dict will skip the term.