lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anna Hunecke <A.Hune...@topdesk.com>
Subject AW: Boolean OR does not work as described
Date Tue, 03 Jan 2012 16:06:12 GMT
Hi Mike,

I think the problem is grouping. If you have a query A AND B OR C, it will be grouped as A
AND (B OR C) and not as you expected as (A AND B) OR C.
Just put parentheses in your query and you get the result that you want.

Best,
Anna

-----Ursprüngliche Nachricht-----
Von: 1983-01-06@gmx.net [mailto:1983-01-06@gmx.net] 
Gesendet: Dienstag, 3. Januar 2012 16:41
An: java-user@lucene.apache.org
Betreff: Boolean OR does not work as described

Hi folks,

I have a query result problem I do not understand. The documentation for Lucene 3.2 query
syntax says the following about boolean OR queries: "The OR operator links two terms and finds
a matching document if either of the terms exist in a document. This is equivalent to a union
using sets."

I have performed several queries on my index and the output does not reflect the description.
I always get the first-wins-set instead of a united set.

These are my separate test results:
1. schluessel:23????? => 286 documents
2. vorgklasse:au AND schluessel:13????? => 2532 documents

If I do:
vorgklasse:au AND schluessel:13????? OR schluessel:23?????
It should unite both sets and output them. I still get 2532 documents back. Exactly those
from the second query.

Am I not supposed to get 2532 + 286 = 2818? This is what I expect as result set.
Am I missing something here? If I group the query like this (vorgklasse:au AND sch
luessel:13?????) OR schluessel:23????? I do get the expected result. But both queries should
be equivalent.

Thanks,

Mike

PS: search output is avaible as CSV at request
-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone


-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de


-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone

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