lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Noll <>
Subject Re: TopDocs question
Date Tue, 16 Sep 2008 03:05:34 GMT
Cam Bazz wrote:
> Hello,
> Could it harm if I make a
>, Integer.MAX_VALUE) ?
> I just need to make a query to get the number of hits in this case,
> but I dont know what the max hits will be.

PriorityQueue will attempt to allocate an array of that size.

But if you only need to know the *number* of hits, and don't need the 
hits themselves, then you should just use a custom HitCollector which 
increments a counter.  It will run much faster.


Daniel Noll

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message