lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Burch <n...@torchbox.com>
Subject Rewrite causes BooleanQuery to loose required terms
Date Thu, 03 Feb 2005 10:38:32 GMT
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?

Thanks
Nick

Mime
View raw message