Sorting on a large index can be very costly. I think you can use TermEnum to get the terms of "another_field" (note that terms are stored sorted in the index) and using the "TermDocs" you can get the corresponding docs of those terms.
See the discusssion "Alternative to looping through Hits". DIGY. -----Original Message----- From: André Maldonado [mailto:andre.maldon...@gmail.com] Sent: Friday, October 30, 2009 6:57 PM To: lucene-net-user@incubator.apache.org Subject: Simple question Hi. This can be a simple question, but I can't figure out the solution. I need to search my index in something like "SELECT TOP 5 ... ORDER BY another_field". But this is an empty query because I want to search in all documents. How can I do it? Thank's