Lucene101PostingsWriter

Constructors

Link copied to clipboard
constructor(state: SegmentWriteState)

Sole public constructor.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun addPosition(position: Int, payload: BytesRef?, startOffset: Int, endOffset: Int)

Add a new position and payload, and start/end offset. A null payload means no payload; a non-null payload with zero length also means no payload. Caller may reuse the BytesRef for the payload between calls (method must fully consume the payload). startOffset and endOffset will be -1 when offsets are not indexed.

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override 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
open override fun finishDoc()

Called when we are done adding positions and payloads for each doc.

Link copied to clipboard
open override fun finishTerm(_state: BlockTermState)

Called when we are done adding docs to this term

Link copied to clipboard
open override 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

Return a newly created empty TermState

Link copied to clipboard
open override fun setField(fieldInfo: FieldInfo)

Sets the current field for writing, and returns the fixed length of long[] metadata (which is fixed per field), called when the writing switches to another field.

Link copied to clipboard
open override fun startDoc(docID: Int, termDocFreq: Int)

Adds a new doc in this term. freq will be -1 when term frequencies are omitted for the field.

Link copied to clipboard
open override fun startTerm(norms: NumericDocValues?)

Start a new term. Note that a matching call to .finishTerm is done, only if the term has at least one document.

Link copied to clipboard
open override 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.