lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley" <yo...@apache.org>
Subject Re: How to avoid score calculation completely?
Date Wed, 23 May 2007 16:53:32 GMT
On 5/23/07, Zhang, Lisheng <Lisheng.Zhang@broadvision.com> 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 http://issues.apache.org/jira/browse/LUCENE-584

-Yonik

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message