Neville Burnell
2007-Feb-23 05:49 UTC
[Ferret-talk] bug with boolean query evaluation containing parenthesis and NOT ?
Hi, The following [simplified] query works well, however a variation which includes parenthesis seems to fail, in that it returns hits which should be excluded by the NOT term. This is surprising because in this simple case, the parenthesis shouldn''t change the Boolean evaluation ... any pointers? Working Query: field1:value1 AND NOT field2:value2 Failing Query: field1:value1 AND ( NOT field2:value2 ) Kind Regards Neville
David Balmain
2007-Feb-23 13:51 UTC
[Ferret-talk] bug with boolean query evaluation containing parenthesis and NOT ?
On 2/23/07, Neville Burnell <Neville.Burnell at bmsoft.com.au> wrote:> Hi, > > The following [simplified] query works well, however a variation which > includes parenthesis seems to fail, in that it returns hits which should > be excluded by the NOT term. > > This is surprising because in this simple case, the parenthesis > shouldn''t change the Boolean evaluation ... any pointers? > > Working Query: field1:value1 AND NOT field2:value2 > Failing Query: field1:value1 AND ( NOT field2:value2 )This is a carry over from Lucene. Currently queries must have at least one positive clause. So a search for; NOT field2:value2 will return nothing. So ANDing this clause with another clause will also return nothing. NOT clauses are more like filters than real boolean clauses I guess. You are correct to say this is surprising and it is something I should probably fix but it isn''t urgent. I''ll put it on my TODO list. Cheers, Dave -- Dave Balmain http://www.davebalmain.com/
David Balmain
2007-Feb-23 15:04 UTC
[Ferret-talk] bug with boolean query evaluation containing parenthesis and NOT ?
On 2/23/07, Neville Burnell <Neville.Burnell at bmsoft.com.au> wrote:> Working Query: field1:value1 AND NOT field2:value2 > Failing Query: field1:value1 AND ( NOT field2:value2 )Ok, I decided to fix this after all. Look out for the next release. I still have a few more bugs to fix but it should be out some time over the weekend. -- Dave Balmain http://www.davebalmain.com/