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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]