org.apache.lucene.search
public class TopDocCollector extends HitCollector
This may be extended, overriding the collect method to, e.g.,
conditionally invoke super() in order to filter which
documents are collected.
| Constructor Summary | |
|---|---|
| TopDocCollector(int numHits) Construct to collect a given number of hits. | |
| Method Summary | |
|---|---|
| void | collect(int doc, float score) |
| int | getTotalHits() The total number of documents that matched this query. |
| TopDocs | topDocs() The top-scoring hits. |
Parameters: numHits the maximum number of hits to collect