You can create two queries from two query parser, one with AND and the other one with OR. After you create both of them, you call setBoost() to give different boost level and then join them together using BooleanQuery with option BooleanClause.Occur.SHOULD. That should do the trick.
askarzaidi wrote: > > Hey Guys, > > Quick question: > > I do this in my code for searching: > > queryParser.setDefaultOperator(QueryParser.Operator.AND); > > Lucene is OR by default so I change it to AND for my requirements. Now, I > have a requirement to do OR as well. I mean while doing AND I'd like to > include results from OR too ... but they'll be much lower ranked than the > AND results. > > Is there a way to do this ? > > thanks, > AZ > > -- View this message in context: http://www.nabble.com/Do-AND-%2B-OR-Search-in-Lucene-tf4205268.html#a11962340 Sent from the Lucene - Java Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]