lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amit" <am...@techepoch.com>
Subject RE: how Boolean query work internally in lucene
Date Sat, 01 Jul 2006 11:24:55 GMT
Thanks Paul for quick reply.

regards,
Amit

-----Original Message-----
From: Paul Elschot [mailto:paul.elschot@xs4all.nl]
Sent: Saturday, July 01, 2006 2:22 PM
To: java-user@lucene.apache.org
Subject: Re: how Boolean query work internally in lucene


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/se
arch/
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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org



---------------------------------------------------------------------
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