lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <>
Subject Re: How to avoid score calculation completely?
Date Wed, 23 May 2007 16:53:32 GMT
On 5/23/07, Zhang, Lisheng <> wrote:
> We have been using lucene for years and it serves us well.
> Sometimes when we issue a query, we only what to know
> how many hits it leads, not want any docs back. Is it possible
> to completely avoid score calculation to get total count back?
> I understand score calculation needs a loop for all matched
> docs, can we avoid the loop, surely this is for performance. We
> want to achieve getting total count at O(1), independent of the
> number of Docs?

Calculating scores adds a low, fixed amount of overhead to the matching logic.
The savings would most likely not be that large.

For simple queries, it might be quickest to use TermDocs() to iterate
over the docs matching terms yourself.

Also, see Matcher in


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

View raw message