The AutomaticFacet controller allows you to create a search interface component that the end user can interact with to refine a query by selecting filters based on item metadata (i.e., field values). Unlike regular facets that need to be explicitly defined and requested in the query, automatic facets are dynamically generated by the index in response to the query.

To learn more about the automatic facet generator feature, see: About the Facet Generator.

interface AutomaticFacet {
    state: AutomaticFacetState;
    deselectAll(): void;
    subscribe(listener: () => void): Unsubscribe;
    toggleSelect(selection: FacetValue): void;
}

Hierarchy (View Summary)

Methods

  • Deselects all automatic facet values.

    Returns void

  • Adds a callback that's invoked on state change.

    Parameters

    • listener: () => void

      A callback that's invoked on state change.

    Returns Unsubscribe

    A function to remove the listener.

  • Toggles the specified automatic facet value.

    Parameters

    Returns void

Properties

The state of the AutomaticFacet controller.