BlockPostingsEnum
- Namespace
- Rowles.LeanCorpus.Codecs.Postings
- Assembly
- Rowles.LeanCorpus.dll
Block-at-a-time postings iterator. Reads packed blocks of 128 doc IDs written by Rowles.LeanCorpus.Codecs.Postings.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
- Implements
NoMoreDocs
Sentinel returned by DocId once the iterator is exhausted.
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.
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 ArrayPool<T>.
NextDoc()
Advances to the next document. Returns the doc ID, or NoMoreDocs.
Reset()
Resets the cursor to before the first document, allowing the list to be re-iterated.