Hah, I forgot that, thanks! ----- Uwe Schindler H.-H.-Meier-Allee 63, D-28213 Bremen http://www.thetaphi.de eMail: [email protected]
> -----Original Message----- > From: Chris Hostetter [mailto:[email protected]] > Sent: Friday, September 17, 2010 7:21 PM > To: [email protected] > Subject: RE: Unexpected Results - using should and must in boolean query > > > : If you have some MUST terms, but you also want to have at least one of a > : list of other terms (like 5 SHOULD clauses), the trick is to separate both: > : Create a BooleanQuery with 2 MUST clauses, one is your required TermQuery > : and the second clause is itself a BooleanQuery with all the SHOULD clauses. > : This ensures that at least one of the SHOULD terms is needed together with > : the MUST term. > > BooleanQuery.setMinimumNumberShouldMatch(1) has hte same effect on > what is matched w/o requiring a nested BooleanQuery -- and because of the > coord factor the scores from the single BooleanQuery will probably better > represent your goal then using the nested BooleanQueries. > > > > -Hoss > > -- > http://lucenerevolution.org/ ... October 7-8, Boston > http://bit.ly/stump-hoss ... Stump The Chump! > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
