lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From RanjithStar <>
Subject Multifield Search with OR and AND on different doc Fields
Date Fri, 04 Jul 2008 06:13:36 GMT

My requirement is to search on SEVEN Fields say F1,F2,F3,F4,F5,F6,F7 having
F1,F2,F3,F4 on one doc index
and F5,F6,F7 on a different doc index

I need to perform a search with ((F1=9 AND F2=4) AND (F3=keyword OR
F4=keyword)) OR (F5=9 AND F6=4 AND F7=keyword)

For normal search I was doing like this:
String[] sFields = { ID1, ID2, TITLE, CONTENT };
String[] sQuery = { id1, id2, sKeyword, sKeyword };
Occur[] flag = { BooleanClause.Occur.MUST, BooleanClause.Occur.MUST,
BooleanClause.Occur.MUST, BooleanClause.Occur.MUST }; 
Query oQuery = oMultiParser.parse(sQuery, sFields, flag, oAnalyzer) ;
Hits hits =;

How can I modify the above query in such a way that it has to search on
different doc Indexes?
Please reply ASAP.
View this message in context:
Sent from the Lucene - Java Developer mailing list archive at

View raw message