Method TopDocs
TopDocs()
Returns the top docs that were collected by this collector.
Declaration
Returns
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 start
, you should call TopDocs() and work
with the returned TopDocs object, which will contain all the
results this search execution collected.
Declaration
public TopDocs TopDocs(int start)
Parameters
Type |
Name |
Description |
System.Int32 |
start |
|
Returns
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 TopDocs() and work with the
returned TopDocs object, which will contain all the results this
search execution collected.
Declaration
public TopDocs TopDocs(int start, int howMany)
Parameters
Type |
Name |
Description |
System.Int32 |
start |
|
System.Int32 |
howMany |
|
Returns