lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From patel mrugesh <>
Subject Re: NOT Operator with Parenthesis
Date Wed, 28 Oct 2015 09:19:31 GMT
Thanks Jigar :)
It's really helpful.

     On Wednesday, 28 October 2015 12:05 AM, Jigar Shah <> wrote:

 Most probably LUCENE-6249 changes parser's behavior, for your case.

On Tue, Oct 27, 2015 at 5:33 AM, patel mrugesh <> wrote:

Thanks for your reply Erick,
I have gone through the document provided by you.
However what I have observed is that there is difference if we parse query with Lucene 4.10.3
and Lucene 5.2.0 onwards.
For example :Query String: lottery AND (NOT ticket)Lucene 4.x parsed it as: +lottery +ticket
Lucene 5.1.x parsed it as: +lottery +(-ticket)
And I want result as 5.1.x produces. But as I am not planning to upgrade lucene now so looking
for fix for lucene 4.10.x.
Please could you help on this?

     On Monday, 26 October 2015 8:03 PM, Erick Erickson <>

 Solr does not do strict Boolean logic, although it comes close. See:


On Sun, Oct 25, 2015 at 11:18 PM, patel mrugesh
<> wrote:
>  Hi All,
> We are using Lucene 4.10.3, one strange behavior we have observed when NOT operator is
used with parenthesis around.
> It looks like NOT operator is completely ignored and whatever boolean operator was before
parenthesis is applied.
> For example, document text: "lottery ticket", query: "lottery NOT ticket". As expected,
this query will not produce a match for this document. However, if this query is slightly
modified and converted to "lottery (NOT ticket)" or "lottery AND (NOT ticket)" then match
is produced. It behaves as if query becomes "lottery AND ticket" instead, completely ignoring
> Please somebody can shed light on this?
> Thanks,Mrugesh


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message