Autocomplete
Autocomplete is a search field with a dropdown that suggests results as the visitor types. It's a filter widget, so you add it to a View like any other filter, and it works with every backend.
Add autocomplete
- Open a View and go to the Filters tab.
- Add a filter and set Select type to Autocomplete.
- Set the Placeholder text.
- Choose the dropdown's sources and what happens on search (below).
- Place it with its shortcode.
Use autocomplete instead of a Search Box, not alongside one on the same index.
Dropdown sources
| Source | Shows |
|---|---|
| Hit previews | Matching records; selecting one opens its link. Set the Title field, the Link field (or "Not clickable") and how many to show. On by default, showing 5. |
| Query completions | Distinct titles of matching records, as suggested search terms. |
| Recent searches | The visitor's own recent searches, stored in their browser. |
| Query Suggestions (Algolia only) | Popular searches from an Algolia Query Suggestions index. Enter the index name. Ignored on other backends. |
On search
When the visitor presses Enter, autocomplete can either:
- Filter results on this page: the default, for a search page that already shows results
- Redirect to a results page: for a search field in a header or sidebar. Enter the Results page URL; the search is added as
?s=…