How to get total number of potential results in Lucene

Posted by Slace on Stack Overflow See other posts from Stack Overflow or by Slace
Published on 2010-04-06T23:15:07Z Indexed on 2010/04/06 23:33 UTC
Read the original article Hit count: 162

Filed under:

I'm using lucene on a site of mine and I want to show the total result count from a query, for example:

Showing results x to y of z

But I can't find any method which will return me the total number of potential results. I can only seem to find methods which you have to specify the number of results you want, and since I only want 10 per page it seems logical to pass in 10 as the number of results.

Or am I doing this wrong, should I be passing in say 1000 and then just taking the 10 in the range that I require?

© Stack Overflow or respective owner

Related posts about lucene