lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Naber <>
Subject too many parentheses confuse Lucene
Date Tue, 05 Dec 2006 21:03:51 GMT

a query like 
(-merkel) AND schröder 

is parsed as
+(-body:merkel) +body:schröder

I get no hits for this query because +(-body:merkel) doesn't return any 
hits (it's not a valid query for Lucene). However, a query like

-merkel AND schröder 

works fine. From the user's point-of-view, both queries should return the 
same result set. One solution I see is to add a MatchAllDocsQuery clause 
to all prohibited clauses in QueryParser's getBooleanQuery() method. Is 
that a valid solution? I tried with some simple cases and it seems to 
work. Any other ideas to solve or work around this issue?



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

View raw message