You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by Cheolgoo Kang <ap...@gmail.com> on 2005/02/08 16:07:14 UTC

Weird BooleanQuery behavior

Hi all,

I'm getting some weird results using BooleanQuery.
Let's see an example. Here's a simple OR-connected query.

T:files T:deleting C:thanks C:exists

The query above hits 1 document. But following *same* query only with
parenthesis results nothing.

(T:files T:deleting) (C:thanks C:exists)

Another combinations of MUST and SHOULD.

"T:files T:deleting +C:production +C:optimize" hits 1 document.
"(T:files T:deleting) (+C:production +C:optimize)" hits 1 document.

Isn't it weird? Is it an expected behavior?

-- 
Cheolgoo, Kang

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: Weird BooleanQuery behavior

Posted by Paul Elschot <pa...@xs4all.nl>.
On Tuesday 08 February 2005 16:07, Cheolgoo Kang wrote:
> Hi all,
> 
> I'm getting some weird results using BooleanQuery.
> Let's see an example. Here's a simple OR-connected query.
> 
> T:files T:deleting C:thanks C:exists
> 
> The query above hits 1 document. But following *same* query only with
> parenthesis results nothing.
> 
> (T:files T:deleting) (C:thanks C:exists)

These two queries should give the same result.

Could you provide a test case that reproduces this?

A simple example test case is in the source code of TestNot.java
currently available from here:
http://svn.apache.org/repos/asf/lucene/java/tags/lucene_1_4_3/src/test/org/apache/lucene/search/
You could also add a main() method when you don't want to use JUnit.

> 
> Another combinations of MUST and SHOULD.
> 
> "T:files T:deleting +C:production +C:optimize" hits 1 document.
> "(T:files T:deleting) (+C:production +C:optimize)" hits 1 document.
> 
> Isn't it weird? Is it an expected behavior?

That depends on the index that is being searched.
A correct result could be the same document for both queries.


Regards,
Paul Elschot


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: Weird BooleanQuery behavior

Posted by Cheolgoo Kang <ap...@gmail.com>.
Thanks Paul,


On Wed, 9 Feb 2005 08:51:17 +0100, Paul Elschot <pa...@xs4all.nl> wrote:
> On Wednesday 09 February 2005 04:38, Cheolgoo Kang wrote:
> > Thanks,
> >
> > I've created a bug report and attached a test case. I'm looking into the
> 
> Thanks a lot. I read through the test code and it looks good.
> 
> There is a lack of testcases for BooleanQuery, so would it be ok to
> add the Apache Licence and assign the copyright to the ASF?
> 
You can use the test case I've submitted as much as you want, like adding the
Apache License and copyright assigned to the ASF.

> > BooleanQuery and BooleanScorer class but it's too *deep* to dig into :-)
> 
> There has also been a recent addition in the development branch.
> 
> Regards,
> Paul Elschot
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 
> 


-- 
Cheolgoo, Kang

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: Weird BooleanQuery behavior

Posted by Paul Elschot <pa...@xs4all.nl>.
On Wednesday 09 February 2005 04:38, Cheolgoo Kang wrote:
> Thanks,
> 
> I've created a bug report and attached a test case. I'm looking into the

Thanks a lot. I read through the test code and it looks good.

There is a lack of testcases for BooleanQuery, so would it be ok to
add the Apache Licence and assign the copyright to the ASF?

> BooleanQuery and BooleanScorer class but it's too *deep* to dig into :-)

There has also been a recent addition in the development branch.

Regards,
Paul Elschot


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: Weird BooleanQuery behavior

Posted by Cheolgoo Kang <ap...@gmail.com>.
Thanks,

I've created a bug report and attached a test case. I'm looking into the
BooleanQuery and BooleanScorer class but it's too *deep* to dig into :-)


On Tue, 8 Feb 2005 19:57:16 +0100, Daniel Naber
<da...@t-online.de> wrote:
> On Tuesday 08 February 2005 16:07, Cheolgoo Kang wrote:
> 
> > The query above hits 1 document. But following *same* query only with
> > parenthesis results nothing.
> >
> > (T:files T:deleting) (C:thanks C:exists)
> 
> Could you please write a small test case, open a bug report and attach the
> test case?
> 
> Regards
>  Daniel
> 
> --
> http://www.danielnaber.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: lucene-dev-help@jakarta.apache.org
> 
> 


-- 
Cheolgoo, Kang

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org


Re: Weird BooleanQuery behavior

Posted by Daniel Naber <da...@t-online.de>.
On Tuesday 08 February 2005 16:07, Cheolgoo Kang wrote:

> The query above hits 1 document. But following *same* query only with
> parenthesis results nothing.
>
> (T:files T:deleting) (C:thanks C:exists)

Could you please write a small test case, open a bug report and attach the 
test case?

Regards
 Daniel

-- 
http://www.danielnaber.de

---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org