If you want OR, you need to make all clauses SHOULD, no MUSTs.
Erik On Jun 27, 2006, at 4:50 AM, heritrix.lucene wrote:
Hi i am using lucene 1.9.1. My query is : (subject:cs OR author:ritchie) I am creating one Boolean query for two TermQueries. t1 = new Term("subject", "cs") t2 = new Term("author","ritchie") for this the BooleanQuery i created is: BooleanQuery mergedQuery = new BooleanQuery(); mergedQuery.add(new TermQuery(t1),BooleanClause.Occur.MUST); mergedQuery.add(new TermQuery(t2),BooleanClause.Occur.SHOULD); When i saw the final query using i found +subject:cs author:ritchie Now when i go for search using this query it gave me all "subject:cs" results. But i was expecting that it will give me the union of two. What's wrong with this??? With Regards....
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]