lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Soeren Pekrul <soeren.pek...@gmx.de>
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)
d(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".

Sören



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