On Saturday 01 July 2006 09:37, Amit wrote:
> Hi All,
> 
> I just want to know how the lucene processes the Boolean query internally??
> 
> As per my knowledge:
> 
>    if I search for "java apache".

This is a PhraseQuery internally in Lucene.

>    Note: let consider i want documents that contents both words and i
> constructed boolean query for that (i.e. +java +apache).
> 
>    Please let me clear if i wrong how lucene process this query?
>    First it search for all document for java then for apache and after that
> it take the intersection of these to sets. is it?
>    if so where i want to know where lucene take the intersection and how
> process the query??

It's a mix of determining the documents per term and merging.
It works in the order of the internal document number, (which is the order
of addition to the index, ) for both sets of documents.
To determine the next matching document each set of documents
advances to the document number at or after the current document of the
other set, until both sets have the same document number.

The intersection is taken in ConjunctionScorer and the sets are
represented by a TermScorer, both viewable in this package:
http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/search/
Advancing to a document number at or after a given document number
is done in the skipTo() methods.

Regards,
Paul Elschot

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to