

PostingAccumulator
- Namespace
- Rowles.LeanLucene.Index.Indexer
- Assembly
- Rowles.LeanLucene.dll
Accumulates doc IDs, term frequencies, and positions for a single qualified term during indexing. Uses ArrayPool-backed buffers to avoid GC pressure from repeated resize-copy-abandon cycles. Call ReturnBuffers() after flush to return rented arrays.
internal sealed class PostingAccumulator
PostingAccumulator
PostingAccumulator()
Count
DocIds
EstimatedBytes
Estimated heap bytes consumed by this accumulator's pooled buffers, plus a fixed 64-byte overhead for the object itself. Cached and updated only when buffers grow, so reads are O(1).
HasFreqs
HasPayloads
HasPositions
Add(int, int)
AddDocOnly(int)
AddWithPayload(int, int, byte[]?)
GetFreq(int)
GetPayload(int, int)
GetPositions(int)
RemapDocIds(int[])
Translates doc IDs using the inverse permutation and re-sorts entries so doc IDs remain in ascending order (required by the postings codec).
ReturnBuffers()
Returns all pooled arrays. Call once after flush; do not use the accumulator afterwards.