-
Controllers
- Category Facet Controller
- Category Facet Search Controller
- Context Controller
- Date Facet Controller
- Did You Mean Controller
- Facet Controller
- Facet Manager Controller
- Facet Search Controller
- History Controller
- Numeric Facet Controller
- Pager Controller
- Query Error Controller
- Query Summary Controller
- Range Facet Controller
- Recommendation Controller
- Result List Controller
- Results Per Page Controller
- Search Box Controller
- Sort Controller
- Standalone Searchbox Controller
- Tab Controller
Search Box Controller
The SearchBox
headless controller offers a high-level interface for designing a common search box UI controller.
Initializer
Options
id
(String)
A unique identifier for the controller. By default, a unique random identifier is generated.
numberOfSuggestions
(Number)
The number of query suggestions to request from Coveo ML (e.g., 3
).
Using the value 0
disables the query suggest feature.
Default: 5
Methods
clear
Clears the search box text and the suggestions.
hideSuggestions
Clears the suggestions.
selectSuggestion
Selects a suggestion and calls submit
.
Parameters:
-
value: string
The string value of the suggestion to select
showSuggestions
Shows the suggestions for the current search box value.
submit
Triggers a search query.
updateText
Updates the search box text value and shows the suggestions for that value.
Parameters:
-
value: string
The string value to update the search box with.
state
The state of the SearchBox
controller.
Returns SearchBoxState