lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Hummel <>
Subject Strange Behaviour of BooleanQuery?
Date Thu, 08 Feb 2007 09:33:17 GMT
Hi @all,

I'm a little confused about the behaviour of BooleanQuery. I have a custom
parser that analyzes some text and constrcuts an "ANDed" BooleanQuery. toString
delivers something like this:

  (+field1:term1 +field2:term2)

Looks pretty normal to me, but the problem is it delivers no results (although
there are matching ones of course). What makes it even more confusing is the
fact that when I take the above query and use it with the QueryParser it works
and delivers the expected results...

Any ideas? Perhaps anyone who is able to reproduce it? Am I doing something
wrong or is there a bug?

Here is how I produce the BooleanQuery:

BooleanQuery bq = new BooleanQuery();
for (iterate over terms) {
   t = new Term(field, term);
   bq.add(new TermQuery(t), BooleanClause.Occur.MUST);

Any help appreciated, thanks in advance!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message