Section navigation

Public struct 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

Public field NoMoreDocs

Sentinel returned by DocId once the iterator is exhausted.

Public property CurrentBlockIndex

Returns the current block index (0-based). -1 if no block decoded yet.

Public property CurrentGlobalIndex

Returns the current zero-based index in the overall postings list.

Public property DocFreqCount

Total number of documents in this posting list.

Public property DocId

Current doc ID, or NoMoreDocs if exhausted.

Public property Freq

Frequency of current doc (freq-1 stored, we add 1 back).

Public property IsExhausted

True once every block has been consumed and no further docs are available.

Public method 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.

Public method Create(IndexInput, long, long, int, bool)

Creates a BlockPostingsEnum positioned before the first document. Call NextDoc() to advance to the first document.

Public method Dispose()

Returns all rented buffers back to ArrayPool<T>.

Public method NextDoc()

Advances to the next document. Returns the doc ID, or NoMoreDocs.

Public method Reset()

Resets the cursor to before the first document, allowing the list to be re-iterated.