Design an in-product search experience
Inputs
content_types(required): What can be searched (for example documents, people, orders, products, settings), roughly how many of each, their key fields and metadata, and any permission rules on who can see what.users_and_tasks(optional): Who searches and what they are trying to do - known-item lookups, exploring, comparing - plus any search logs, top queries or complaints you have. Optional.
Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.
If you do not know what content is searchable, ask and stop. Otherwise state assumptions about users and tasks and continue.
- Search jobs. The main jobs (known-item, exploratory, narrowing), ranked by likely frequency, with example queries for each. These drive every later choice.
- Entry point and scope. Where search lives (persistent box or icon, keyboard shortcut such as "/" or Cmd/Ctrl+K), global versus in-section search, and how the current scope is shown and changed.
- Query input and autocomplete. Placeholder text that hints at what can be searched; recent searches; autocomplete with query suggestions and direct result suggestions grouped by content type (five to eight items), the matched text highlighted, full keyboard navigation, and a reasonable delay before querying. Tolerance for typos, plurals, synonyms, partial words and exact IDs or codes.
- Results. Layout per content type: what each result shows (title, snippet with matched terms highlighted, type badge, key metadata, owner or date), how mixed types are grouped or tabbed, the result count, loading states, pagination or progressive loading, and direct actions from the result where useful. Respect permissions: never reveal titles of items the user cannot open.
- Filters and sorting. The facets for each content type, with counts; how applied filters appear as removable chips with "Clear all"; default sort (relevance) and alternatives; how filters work on mobile (a sheet with an apply button and a live result count). Hide or disable options that would return nothing.
- Zero results and errors. A helpful zero-results state: spelling suggestion, removing filters with one tap, broadening the scope, popular or recent items, and a way forward (create the item, ask someone, contact support). Log every zero-result query. Also the error and slow-response states.
- Relevance signals. The ranking signals to start with and the order to test them: field weighting (title above body), exact and prefix matches, ID matches first, recency, popularity or usage, the user's own and recently viewed items, and content type priority for the main job. Note which need data you may not have.
- Measurement and tests. Metrics: search usage rate, zero-result rate, click-through rate, position of first click, query reformulation rate, search exits, and time to a successful click. An offline relevance check: a set of 30 to 50 real top queries with the expected best results, rerun whenever ranking changes. Two or three experiments with hypotheses.
- Accessibility. Combobox semantics for autocomplete, announced result counts and filter changes, focus order between input, suggestions, filters and results, and visible focus.