The TopDocsCollector type exposes the following members.
Constructors
Name | Description | |
---|---|---|
TopDocsCollector | Initializes a new instance of the TopDocsCollector class |
Methods
Name | Description | |
---|---|---|
AcceptsDocsOutOfOrder |
* Return (Inherited from Collector.)CopyC# true CopyC# Collector CopyC# true | |
Collect | Called once for every document matching a query, with the unbased document
number.
Note: This is called in an inner search loop. For good search performance,
implementations of this method should not call {@link Searcher#Doc(int)} or
{@link Lucene.Net.Index.IndexReader#Document(int)} on every hit.
Doing so can slow searches by an order of magnitude or more.
(Inherited from Collector.) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetTotalHits | The total number of documents that matched this query. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
NewTopDocs | Returns a {@link TopDocs} instance containing the given results. If
CopyC# results | |
PopulateResults | Populates the results array with the ScoreDoc instaces. This can be
overridden in case a different ScoreDoc type should be returned.
| |
SetNextReader | Called before collecting from each IndexReader. All doc ids in
{@link #Collect(int)} will correspond to reader.
Add docBase to the current IndexReaders internal document id to re-base ids
in {@link #Collect(int)}.
(Inherited from Collector.) | |
SetScorer | Called before successive calls to {@link #Collect(int)}. Implementations
that need the score of the current document (passed-in to
{@link #Collect(int)}), should save the passed-in Scorer and call
scorer.score() when needed.
(Inherited from Collector.) | |
TopDocs()()()() | Returns the top docs that were collected by this collector. | |
TopDocs(Int32) | Returns the documents in the rage [start .. pq.size()) that were collected
by this collector. Note that if start >= pq.size(), an empty TopDocs is
returned. This method is convenient to call if the application allways asks for the last results, starting from the last 'page'. NOTE: you cannot call this method more than once for each search execution. If you need to call it more than once, passing each time a different CopyC# start | |
TopDocs(Int32, Int32) | Returns the documents in the rage [start .. start+howMany) that were
collected by this collector. Note that if start >= pq.size(), an empty
TopDocs is returned, and if pq.size() - start < howMany, then only the
available documents in [start .. pq.size()) are returned. This method is useful to call in case pagination of search results is allowed by the search application, as well as it attempts to optimize the memory used by allocating only as much as requested by howMany. NOTE: you cannot call this method more than once for each search execution. If you need to call it more than once, passing each time a different range, you should call {@link #TopDocs()} and work with the returned {@link TopDocs} object, which will contain all the results this search execution collected. | |
ToString | (Inherited from Object.) |
Fields
Name | Description | |
---|---|---|
EMPTY_TOPDOCS | ||
pq | The priority queue which holds the top documents. Note that different
implementations of PriorityQueue give different meaning to 'top documents'.
HitQueue for example aggregates the top scoring documents, while other PQ
implementations may hold documents sorted by other criteria.
| |
totalHits | The total number of documents that the collector encountered. |