Alpha
Alpha
Resets the query in the controller state and clears the category filter suggestions.
Alpha
Returns the serialized search parameters for the current search query and specified category filter suggestion.
For example, q=jeans&cf-ec-category=Clothes,Pants
.
In a typical scenario, this method should called when the user selects a category filter suggestion from a standalone search box. The returned string is then used to pass the correct URL query parameters or fragment when redirecting the browser to the search page.
When the user selects a category filter suggestion from the main search box on the search page, use the select
method instead.
The category filter suggestion to serialize.
The serialized search parameters for the current search query and specified category filter suggestion.
Alpha
Clears all facet values, selects the specified category filter suggestion, updates the query, and executes a new search request.
In a typical scenario, this method should be called when the user selects a category filter suggestion from the main search box on the search page.
When the user selects a category filter suggestion from a standalone search box, use the getSearchParameters
method instead.
The category filter suggestion to select.
Alpha
Adds a callback that's invoked on state change.
A callback that's invoked on state change.
A function to remove the listener.
Alpha
Sets the query in the controller state to the specified value and requests category filter suggestions based on the updated query.
For example, if this method is called with jeans
as an argument, it will request values from the controller's
field (e.g., ec_category
) that would return results if selected when the search query is jeans
(such as
Clothing
, Clothing;Pants
, and Clothing;Shorts
).
The search query to use as context to request the category filter suggestions. In a typical scenario, this should set to the current value of the search box input.
The
CategoryFilterSuggestions
controller provides methods to request and interact with category facet suggestions based on a specific field for a given search query.This controller relies on a Commerce API functionality that is not yet generally available. If you wish to use this feature in an implementation, please contact your Coveo representative.