Table of Contents

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

Public fieldConstant NoMoreDocs

Sentinel returned by DocId once the iterator is exhausted.

Properties

Public propertyRead-only CurrentBlockIndex

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

Public propertyRead-only CurrentGlobalIndex

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

Public propertyRead-only DocFreqCount

Total number of documents in this posting list.

Public propertyRead-only DocId

Current doc ID, or NoMoreDocs if exhausted.

Public propertyRead-only Freq

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

Public propertyRead-only IsExhausted

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

Internal propertyRead-onlyInternal SkipEntries

Returns the skip entries for WAND scoring. Each entry has MaxFreqInBlock and MaxNormInBlock.

Methods

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 methodStatic 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 System.Buffers.ArrayPool`1.

Public method NextDoc()

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