I think you have explained it perfectly on how the tag exclusion makes it a different facet field and that no logic of default/invariants/appends would be able to solve this
I went with the custom component approach. Although a very hacky solution could be defining this in defaults: <str name="facet.field">{!ex=foo}category</str> <str name="facet.field">{!ex=bar}brand</str> And ensure whenever clients filter docs they use the following syntax: &fq={!tag=foo}category:"cat" On Thu, Oct 24, 2013 at 11:01 PM, Chris Hostetter <hossman_luc...@fucit.org>wrote: > > : Now a client wants to use multi select faceting. He calls the following > API: > : > http://localhost:8983/solr/collection1/search?q=*:*&facet.field={!ex=foo}category&fq={!tag=foo}category > : :"cat" > > : Putting the facet definitions in "appends" cases it to facet category 2 > : times. > : > : Is there a way where he does not have to provide all the facet.field > : parameters in the API call? > > What you are asking is essentially "I want to configure faceting on X and > Y by default, but i want clients to be able to add faceting on Z and have > that disable faceting on X while still faceting on Y" > > It doens't matter that X and Z are both field facets based arround the > field name "category" -- the tag exclusion makes them completley > different. > > The basic default/invariants/appends logic doesn't give you any easy > mechanism to ignore arbitrary params like that - you could probably write > a custom component that inspected the params and droped ones you don't > want, but this wouldn't make sense as generalized logic in the > FacetComponent since faceting on a field both with and w/o a tag > expclusion at the same time is a very common use case. > > > > > -Hoss > -- Regards, Varun Thacker http://www.vthacker.in/