The Lucene documents tell me that “Hits” will be removed from the API in Lucene 3.0.
Deprecated. Hits will be removed in
Lucene 3.0. Use search(Query, Filter,
int) instead.
The proposed overload limits the number of documents returned to the value of the int.
So my question is: what is the recommended way to perform a search in Lucene with no limit on the number of documents to be returned?
The highest integer in Java is pretty darned high, you could use
Integer.MAX_VALUEfor the limit. I bet something else breaks before you actually hit the limit of 2^31-1 (2,147,483,647) documents. 🙂Alternately, you can use a
HitCollector:search(Query query, HitCollector results)orsearch(Query query, Filter filter, HitCollector results); the docs say: