On Thu, May 29, 2008 at 4:05 PM, Yongjun Rong <[EMAIL PROTECTED]> wrote:
>  I have a question about how the lucene query parser. For example, I
> have query "A AND B AND C". Will lucene extract all documents satisfy
> condition A in memory and then filter it with condition B and C?

No, Lucene will try and optimize this the best it can.

It roughly goes like this..
docnum = find_match("A")
docnum = find_first_match_after(docnum, "B")
docnum = find_first_match_after(docnum,"C")
etc...
until the same docnum is returned for "A","B", and "C".

See ConjunctionScorer for the gritty details.

-Yonik



> or only
> the documents satisfying "A AND B AND C" will be put into memory? Is
> there any articles discuss about how to build a optimization query to
> save memory and improve performance?
>  Thank you very much.
>  Yongjun Rong
>

Reply via email to