function toggleFacetRefinement(facet, value) {
    if (this.isHierarchicalFacet(facet)) {
      return this.toggleHierarchicalFacetRefinement(facet, value);
    } else if (this.isConjunctiveFacet(facet)) {
      return this.toggleConjunctiveFacetRefinement(facet, value);
    } else if (this.isDisjunctiveFacet(facet)) {
      return this.toggleDisjunctiveFacetRefinement(facet, value);
    }

    throw new Error('Cannot refine the undeclared facet ' + facet +
      '; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets');
  }
function toggleFacetRefinement(facet, value) {
    if (this.isHierarchicalFacet(facet)) {
      return this.toggleHierarchicalFacetRefinement(facet, value);
    } else if (this.isConjunctiveFacet(facet)) {
      return this.toggleConjunctiveFacetRefinement(facet, value);
    } else if (this.isDisjunctiveFacet(facet)) {
      return this.toggleDisjunctiveFacetRefinement(facet, value);
    }

    throw new Error('Cannot refine the undeclared facet ' + facet +
      '; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets');
  }
function toggleFacetRefinement ( facet , value ) { if ( this . isHierarchicalFacet ( facet ) ) { return this . toggleHierarchicalFacetRefinement ( facet , value ) ; } else if ( this . isConjunctiveFacet ( facet ) ) { return this . toggleConjunctiveFacetRefinement ( facet , value ) ; } else if ( this . isDisjunctiveFacet ( facet ) ) { return this . toggleDisjunctiveFacetRefinement ( facet , value ) ; } throw new Error ( 'Cannot refine the undeclared facet ' + facet + '; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets' ) ; }
Generic toggle refinement method to use with facet, disjunctive facets
and hierarchical facets
@param  {string} facet the facet to refine
@param  {string} value the associated value
@return {SearchParameters}
@throws will throw an error if the facet is not declared in the settings of the helper
Generic toggle refinement method to use with facet disjunctive facets and hierarchical facets