| UI or UX | UI + UX - Highlighted matching terms and snippets inside returned search results | UI + UX - Search input and result list | UI + UX - Suggested-query surface | UI + UX - Search recovery state |
| UI guidance | Pair highlighted fragments with field labels, match counts, result titles, and enough surrounding snippet text that users can understand why the result is present. | Render a labeled search field, result count, matching rows, and clear action. | Keep suggestions visually tied to the current input. | Render zero-result copy, active criteria, remove-filter actions, and alternative suggestions. |
| UX guidance | Use search result highlighting to explain relevance after a query has returned results, especially when users scan dense documents, records, tickets, messages, or logs. | Help the person reach a clear task outcome. | Help the person reach a clear task outcome. | Help users recover when their own search or filters excluded all results. |
| Good UI | A result card for Benefits appeal policy highlights Benefits in the title and appeal in the snippet, with a small label saying 2 highlighted fields. | A clearly labeled search field with result count and results placed directly below. | Suggestions appear directly below the search field with active row, readable labels, and optional matched text. | Zero-result state shows query/filters, result count, and clear or broaden actions. |
| Bad UI | Old highlighted words remain visible after the user clears the query or switches to a zero-result state. | Results jump, resize, or use heavy borders that make scanning feel like reading a form. | Promoted results styled the same as typed query suggestions. | Huge empty state that hides active filters. |
| Good UX | A user searches benefits appeal and can immediately see which result matched benefits in the title and appeal in the excerpt. | Users can type, revise, clear, and keep context while inspecting results. | Users can keep typing, choose a suggestion, dismiss suggestions, or submit their own query. | Users can remove one filter, clear all, edit query, or try suggested alternatives. |
| Bad UX | Result highlighting is implemented by injecting raw backend HTML into a card, causing unsafe or broken markup. | Search silently changes unrelated filters. | Auto-submitting the top suggestion. | Telling users nothing exists when filters caused the state. |
| Best fit | Results contain enough text that users need to scan for where the query matched. | Users know a word, name, or identifier. | The system can predict likely queries. | Search, browse, or filter controls can produce an empty result set. |
| Avoid when | The result title is the entire match and extra emphasis would add noise. | The task is choosing a command with side effects. | Suggestions are low quality or biased toward irrelevant content. | The state is caused by an error rather than valid empty results. |
| Required state | Submitted query with one or more highlighted result fields. | Empty query state. | Typing state with suggestions. | Zero-result state that preserves the user's criteria. |
| Accessibility burden | Use semantic text markup such as mark for highlighted passages when the highlight indicates relevance in the current search context. | The input has a stable accessible name. | Expose the suggestions list and active option. | Announce result-count changes where search results update dynamically. |
| Common misuse | Highlighting whole cards, rows, or table columns instead of the matching terms. | Using placeholder text as the only label. | Showing unrelated promoted results as suggestions. | Resetting all criteria automatically. |