How to addExcludeRefinement on disjunctive facet?

345 Views Asked by At

I'm trying to add an addExcludeRefinement(facet, value) on a disjunctive facet key, but the implementation doesn't allow that.

if (!this.isConjunctiveFacet(facet)) {
  throw new Error(facet + ' is not defined in the facets attribute of the helper configuration');
}

How can I do that without having to modify the property excludesFacets itself ?

1

There are 1 best solutions below

0
On

Negative faceting can only be use with conjunctive facets. However, you can hardcode an exclusion using the filters attribute in the parameters. I did a jsFiddle that demonstrate that: https://jsfiddle.net/bobylito/ef4615hk/