Rowles.LeanLucene.Codecs.Postings
Classes
BlockPostingsWriter
Writes postings in packed block format (v3). Doc IDs and frequencies are written in 128-int delta-encoded packed blocks, with VarInt encoding for the tail (remaining < 128 values). Skip data is emitted after every block for efficient
Advance().
PackedIntCodec
Frame-of-Reference bit-packing codec for blocks of 128 integers. Packs values using the minimum number of bits needed for the largest value in the block.
Output format:
[numBits : 1 byte][packed data : numBits × 16 bytes]. WhennumBitsis 0 (all values are zero) the output is a single byte.
PostingsReader
Reads delta-encoded postings lists written by PostingsWriter.
PostingsWriter
Writes delta-encoded postings lists for a given term. Deltas are encoded as variable-length integers (VarInt/LEB128) for compactness.
Structs
BlockPostingsEnum
Block-at-a-time postings iterator (v3 format). Reads packed blocks of 128 doc IDs written by BlockPostingsWriter. Only the current block is decoded, keeping memory at a constant ~1 KB (2 × 128 ints) regardless of postings list length.
PostingsEnum
Forward-only cursor over a postings list. Decodes doc IDs and frequencies once into ArrayPool-rented buffers, then yields (DocId, Freq) pairs via MoveNext(). Optionally decodes positions when created via CreateWithPositions(IndexInput, long, byte).
Lifetime contract: When using the lazy position path, this struct holds a raw
byte*pointer into a memory-mapped IndexInput. The source input (_sourceInput) must remain open and un-disposed for the entire lifetime of this PostingsEnum. Callers must not dispose the IndexInput while any PostingsEnum referencing it is still alive.
TermPostingMetadata
Metadata returned by FinishTerm() for storage in the term dictionary.