The CategoryFieldSuggestions controller provides query suggestions based on a particular category facet field.

For example, you could use this controller to provide auto-completion suggestions while the end user is typing an item category.

This controller is a wrapper around the basic category facet controller search functionality, and thus exposes similar options and properties.

interface CategoryFieldSuggestions {
    state: CategoryFieldSuggestionsState;
    type: "hierarchical";
    clear(): void;
    search(): void;
    select(value: CategoryFieldSuggestionsValue): void;
    subscribe(listener: () => void): Unsubscribe;
    updateText(text: string): void;
}

Hierarchy (View Summary)

  • Controller
  • FacetControllerType<"hierarchical">
    • CategoryFieldSuggestions

Methods

  • Resets the query and empties the suggestions.

    Returns void

  • Requests field suggestions based on a query.

    Returns void

  • Filters the search using the specified value.

    If a facet exists with the configured facetId, selects the corresponding facet value.

    Parameters

    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.

  • Requests field suggestions based on a query.

    Parameters

    • text: string

      The query with which to request field suggestions.

    Returns void

Properties

type: "hierarchical"