BlockPostingsEnum
- Namespace
- Rowles.LeanLucene.Codecs.Postings
- Assembly
- Rowles.LeanLucene.dll
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.
public struct BlockPostingsEnum : IDisposable
Fields
NoMoreDocs
Sentinel returned by DocId once the iterator is exhausted.
Properties
CurrentBlockIndex
Returns the current block index (0-based). -1 if no block decoded yet.
CurrentGlobalIndex
Returns the current zero-based index in the overall postings list.
DocFreqCount
Total number of documents in this posting list.
DocId
Current doc ID, or NoMoreDocs if exhausted.
Freq
Frequency of current doc (freq-1 stored, we add 1 back).
IsExhausted
True once every block has been consumed and no further docs are available.
SkipEntries
Returns the skip entries for WAND scoring. Each entry has MaxFreqInBlock and MaxNormInBlock.
Methods
Advance(int)
Advances to the first document with ID ≥
target. Uses skip data for O(log N) seeking across blocks and branchless SIMD scanning within blocks.
Create(IndexInput, long, long, int, bool)
Creates a BlockPostingsEnum positioned before the first document. Call NextDoc() to advance to the first document.
Dispose()
Returns all rented buffers back to System.Buffers.ArrayPool`1.
NextDoc()
Advances to the next document. Returns the doc ID, or NoMoreDocs.