lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Elschot <paul.elsc...@xs4all.nl>
Subject Re: Rewrite causes BooleanQuery to loose required terms
Date Thu, 03 Feb 2005 18:48:18 GMT
On Thursday 03 February 2005 11:38, Nick Burch wrote:
> Hi All
> 
> I'm using lucene from CVS, and I've discovered the rewriting a 
> BooleanQuery created with the old style (Query,boolean,boolean) method,
> the rewrite will cause the required parameters to get lost.
> 
> Using old style (Query,boolean,boolean):
> query = +contents:test* +(class:1.2 class:1.2.*)
> rewritten query = (contents:tester contents:testing contents:tests) 
>   (class:1.2 (class:1.2.3 class:1.2.4))
> 
> Using new style (Query,BooleanClause.Occur.MUST):
> query = +contents:test* +(class:1.2 class:1.2.*)
> rewritten query = +(contents:tester contents:testing contents:tests) 
>   +(class:1.2 (class:1.2.3 class:1.2.4))
> 
> Attached is a simple RAMDirectory test to show this. I know that the 
> (Query,boolean,boolean) method is depricated, but should it also be 
> broken?

No.
Currently, the "old" constructor for BooleanClause does not carry the
old state forward.
The "new" constructor does carry the new state backward.

I'll post a fix in bugzilla later.

Thanks,
Paul Elschot.


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


Mime
View raw message