I've been trying to tag a filter and then exclude it from the facet using the approach outlined here: http://shalinsays.blogspot.com/2009/04/tagging-and-excluding-filters.html
This functionality doesn't appear to work correctly in the module. Debugging through the code I can see the query being generated for Solr looks similar to this:
facet.field={!ex=field_star_rating}is_cck_field_star_rating&fq={!tag=is_cck_field_star_rating}is_cck_field_star_rating:5&
Note that the tag is "field_star_rating" but the exclusion is "is_cck_field_star_rating" so in this instance the facet is filtered to the result set and not the super set. The offending line of code seems to be line 475 in apachesolr_search.module where the exclusion is set to the delta and not the facet name.
Hope this helps.
Comments
Comment #1
idontknowtheanswer commentedComment #2
idontknowtheanswer commentedJust to expand on this the behaviour only manifests itself when the facet block is set to "or". I think I've worked round the issue using the following code (note this is just a cut down example, additional sanity checks have been removed):
Would be interested to hear if this is an issue or whether I've misunderstood something.
Thanks,
Comment #3
jpmckinney commentedComment #4
jpmckinney commentedFixed as part of #552152-12: OR facet counts are confusing. Only relevant to 6.x-2.x.