On Monday 29 May 2006 15:54, zzzzz shalev wrote:
> hi all,
>
> is there a faster way to retrieve ONLY the count of
results for a query?
>
> lucene ranks (scores) the first batch of docs and
sorts them by rank, this
is functionality i dont need in certain queries and i
assume, not doing this
can return the count faster then the hits.length()
Untested:
Scorer scorer =
query.weight(indexSearcher).scorer(indexSearcher.getIndexRe
ader());
int docCount = 0;
while (scorer.next()) docCount++;
Regards,
Paul Elschot
------------------------------------------------------------
---------
To unsubscribe, e-mail: java-user-unsubscribe lucene.apache.org
For additional commands, e-mail: java-user-help lucene.apache.org
|