Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-Dev

Multifield Search with OR and AND on different doc Fields

 

 

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded


ranjith2211 at gmail

Jul 3, 2008, 11:13 PM

Post #1 of 1 (180 views)
Permalink
Multifield Search with OR and AND on different doc Fields

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 = indexSearcher.search(oQuery);


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: http://www.nabble.com/Multifield-Search-with-OR-and-AND-on-different-doc-Fields-tp18273461p18273461.html
Sent from the Lucene - Java Developer mailing list archive at Nabble.com.

Lucene java-dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.