Method GetTopDocs
GetTopDocs()
Returns the top docs that were collected by this collector.
Declaration
public virtual TopDocs GetTopDocs()
Returns
Type | Description |
---|---|
TopDocs |
Implements
GetTopDocs(Int32)
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
public virtual TopDocs GetTopDocs(int start)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | start |
Returns
Type | Description |
---|---|
TopDocs |
Implements
GetTopDocs(Int32, Int32)
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
public virtual TopDocs GetTopDocs(int start, int howMany)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | start | |
System.Int32 | howMany |
Returns
Type | Description |
---|---|
TopDocs |