On Mon, 2014-06-23 at 13:58 +0200, Jamie wrote:
> How does one sort the results of a collector as opposed to the entire 
> result set?

With only 50K as page size, this should not be necessary. But for the
record, you do it by implementing a Collector that can potentially hold
all documents in the index (well, their docID & sort key anyway) and
feed it to the search(Query query, Collector results) method in the
IndexSearcher. When the call has finished, run your own sort and extract
the top-X results.

> Do I need to implement my own sort algorithm or is there a way to do 
> this with Lucene?  If so, which API functions do I need to call?

InPlaceMergeSorter is a nice one to extend. But again, with 50K result
sets, this seems like overkill.

- Toke Eskildsen, State and University Library, Denmark



---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-user-h...@lucene.apache.org

Reply via email to