lucene-java-user mailing list archives

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

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?

Regards
 Daniel

-- 
http://www.danielnaber.de

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