Interface ITopDocsCollector
LUCENENET specific interface used to reference TopDocsCollector<T>
without referencing its generic type.
Assembly: Lucene.Net.dll
Syntax
public interface ITopDocsCollector : ICollector
Properties
TotalHits
The total number of documents that matched this query.
Declaration
Property Value
Methods
GetTopDocs()
Returns the top docs that were collected by this collector.
Declaration
Returns
GetTopDocs(int)
Returns the documents in the rage [start
.. pq.Count) that were collected
by this collector. Note that if start
>= pq.Count, an empty TopDocs is
returned.
This method is convenient to call if the application always 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
start
, you should call
GetTopDocs() and work
with the returned
TopDocs object, which will contain all the
results this search execution collected.
Declaration
TopDocs GetTopDocs(int start)
Parameters
Type |
Name |
Description |
int |
start |
|
Returns
GetTopDocs(int, int)
Returns the documents in the rage [start
.. start
+howMany
) that were
collected by this collector. Note that if start
>= pq.Count, an empty
TopDocs is returned, and if pq.Count - start
< howMany
, then only the
available documents in [start
.. pq.Count) 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
GetTopDocs() and work with the
returned
TopDocs object, which will contain all the results this
search execution collected.
Declaration
TopDocs GetTopDocs(int start, int howMany)
Parameters
Type |
Name |
Description |
int |
start |
|
int |
howMany |
|
Returns