On 5/23/07, Zhang, Lisheng <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to