lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Soeren Pekrul <>
Subject Re: Optional terms in BooleanQuery
Date Mon, 21 May 2007 08:44:47 GMT
Peter Bloem wrote:
> "+(A B) C D E"
> In other words, Lucene considers all documents that 
> have both A and B, and ranks them higher if they also have C D or E.

Hello Peter,

for my understanding "+(A B) C D E" means at least one of the terms "A" 
or "B" must be contained and the terms "C", "D", and "E" are optional. 
The following documents d are hits:
d(A, B)
d(A, C)
Documents without "A" and "B" are not a hit.

To have both terms "A" and "B" in a document the query should be: "(+A 
+B) C D E" or "+A +B C D E".


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message