The FacetGenerator headless sub-controller creates commerce facet sub-controllers from the Commerce API search or product listing response.

Commerce facets are not requested by the implementer, but rather pre-configured through the Coveo Merchandising Hub (CMH). The implementer is only responsible for leveraging the facet controllers created by this sub-controller to properly render facets in their application.

interface FacetGenerator {
    facets: GeneratedFacetControllers;
    state: string[];
    deselectAll(): void;
    subscribe(listener: (() => void)): Unsubscribe;
}

Hierarchy (view full)

Methods

Properties

Methods

Properties

facets: GeneratedFacetControllers

The facet sub-controllers created by the facet generator. Array of RegularFacet, DateRangeFacet, NumericFacet, and CategoryFacet.

state: string[]

The ordered list of facet IDs for which sub-controllers will be created and returned when the facets getter is called.