Table of Contents

Public struct TopNCollector

Namespace
Rowles.LeanLucene.Search.Scoring
Assembly
Rowles.LeanLucene.dll

Bounded min-heap collector that keeps the top-N highest-scoring documents. Single allocation: the ScoreDoc[topN] backing array.

public struct TopNCollector

Constructors

Public constructor TopNCollector(ScoreDoc[], int)

Constructs a collector using an externally-owned backing array (avoids allocation).

Public constructor TopNCollector(int)

Initialises a new TopNCollector with the specified capacity.

Properties

Public propertyRead-only Capacity

Gets the maximum number of documents this collector can retain.

Methods

Public method Collect(int, float)

Collects a matching document and its score, keeping only the top-N by score.

Public method Reset()

Resets state for reuse, keeping the backing array.

Public method ToTopDocs()

Materialises the collected results as a TopDocs sorted by score descending.