- style
Search with Auto-Suggest
Description
Search with auto-suggest is a type of Search that provides the user with relevant suggestions before the search is submitted.
Basic Flow
After entering one character, the system will check for suggestions (Where there is a technical constraint, suggestions may be shown after entering 3 characters).
If at least one suggestion is found, the auto-suggest box will open.
The list will refresh after each additional keystroke.
The list will show up to 8 items with no scroll bar.
Items will be sorted by the frequency, from high to low. Other sort options can be used as needed (e.g. alphabetical, relevancy etc.).
No item will be selected by default.
Interactions
The user may select an item from the auto-suggest box by either using the mouse, or by using the Up and Down keys (the first down keystroke will select the first item).
A search is performed after either:
selecting a suggestion,
clicking the search button, or
hitting the Enter key.
Clicking Esc will exit the auto-suggest box and return the focus to the search bar.
Clicking outside the auto-suggest box will close it.
Recent and Popular Searches (optional)
When an empty search field is in focus, a list of recent or popular/trending suggestions may be displayed, enabling the user to perform a quick search.
The suggestions list will include up to 8 items.
There are 3 types of possible suggestions:
Recent items are strings that the specific user has searched for in the past. They will be presented only after the user has conducted at least one previous search, and will include the most recent searches only.
Popular items are strings that are being frequently searched by a lot of users.
Trending items are strings that are being frequently searched by a lot of users, within a recent time frame.
All recent items should always be first.
Popular and trending items should not both be shown in the same list.
The number of recent and popular/trending items should be equal, unless there’s not enough data to provide an equal amount of both types. In this case, the list may be divided unequally.
Each item will be accompanied by an icon, indicating the type of suggestion (recent or popular/trending).
Use this search type only if the user is expected to search for previously searched queries or popular/trending queries.
Validations and errors
No results found
When no results are found the auto-suggest box will display:
the text No <items> found (e.g. categories, employees etc.).
suggestions for improving the search, for example:
Make sure all words are spelled correctly.
Try different or fewer keywords.
When possible, provide specific solutions suited to the specific database. For example, when searching for employees, recommend searching by ID or employee number.
Spelling errors (optional)
Misspelled queries should be auto-corrected to the best known query, while allowing the user to revert to the original query:
In this case, the search box will show the text:
showing results for <corrected term>; Search <original term> instead.
Invalid characters (optional)
If the user enters invalid characters (for example, !#$% for text-based values), the search box will display a relevant message.
Best Practice
Use:
when the database is of a medium-large size.
when results need to be retrieved from the backend.
Don’t use:
for small or simple databases → use Live Search instead.
Accessibility compliance
Unless otherwise specified, see our general compliance information in Fundamentals - Accessibility.
Design
See Search.
Code
See Search.