That works great, thanks! Jan
On 21 November 2012 19:52, Shai Erera <ser...@gmail.com> wrote: > Hi Jan, > > Basically, DrillDown is a helper class for creating such queries. You're > right that its query() methods create AND, because that's normally the > case, but if you require OR, you could do this: > > BooleanQuery res = new BooleanQuery(); > for (CategoryPath cp : paths) { > res.add(new TermQuery(DrillDown.term(iParams, cp)), Occur.SHOULD); > } > > I copied the code from DrillDown.query(FacetIndexingParams, > CategoryPath...) and modified Occur.MUST to Occur.SHOULD. > > Can you give it a try? > > Shai > > > On Wed, Nov 21, 2012 at 7:27 PM, Jan Stette <jan.ste...@gmail.com> wrote: > >> Hi, >> >> I'm trying to use Lucene Facet for doing faceted searches. I've hit a >> problem with a use case where users in my application needs to be able to >> select multiple facets then run a search for things that match either of >> the facets. >> >> Using DrillDown.query(), it treats multiple facets using AND, so that it >> returns hits that match all of the given facets, as described here: >> >> http://lucene.apache.org/core/3_6_1/api/all/org/apache/lucene/facet/search/DrillDown.html >> . >> >> That's good for some use cases, but not for all. Is there a way to specify >> OR instead of AND for drilldown queries. Alternatively, a way to achieve >> the same result using another type of query? >> >> Regards, >> Jan >> > >