Sub topic 2
Search, filtering, and browsing: choosing the right tool
This chapter helps you decide which finding mechanism fits a given user task. It assumes you know basic web or mobile interfaces, understand lists and form controls, and can read short TypeScript and HTML examples. Later chapters cover the search field, filter controls, and facets in detail. Here the goal is to pick the right tool before you build it.
Three ways to find things
Apps offer three main ways to find an item. Each one suits a different starting point.
- Search is a text-driven way to find items. The user types words and the system returns matching items. The user must already know something to type.
- Filtering is a way to narrow a visible set of items by attributes such as category, price, or date. The user picks constraints from controls and the list shrinks.
- Browsing is a way to explore items by moving through a structure such as menus, categories, or curated collections. The user doesn't need to name anything. They recognize what they want when they see it.
The three are not exclusive. Most good products combine them. A shopper might browse into "Boots", search within it for "waterproof", and then filter by size. The design question is which one leads for a given task, and which ones support it.
Match the tool to what the user knows
The most useful question is: what does the user already know about the thing they want? The answer points to a mechanism.
| User's knowledge | Typical task | Best lead tool | Example |
|---|---|---|---|
| Knows the exact name or ID | Known-item lookup | Search | Finding order "#48213" |
| Knows a few attributes, not the name | Narrowing | Filtering | Laptops under $1,000 with 16 GB RAM |
| Knows the general area only | Exploration | Browsing | Looking at gift ideas |
| Knows a need but not the vocabulary | Discovery | Browsing plus search suggestions | Finding "something to fix a squeaky door" |
| Wants to compare options | Evaluation | Filtering plus sorting | Comparing flights |
Researchers often describe these as lookup, learning, and investigation tasks. For interface design, the practical split is simpler. If the user can name the target, search is fastest. If the user can describe the target by properties, filtering is fastest. If the user can't describe it yet, browsing helps them build the vocabulary.
What each tool needs from the data
A tool only works if your data supports it. Check this before choosing.
- Search needs text that people would actually type: titles, names, descriptions, tags. If items have little text, such as photos or sensor readings, search is weak.
- Filtering needs structured attributes with consistent values. A "color" field that holds "Navy", "navy blue", and "dark blue" makes a poor filter.
- Browsing needs a sensible hierarchy or grouping. If items belong in many places at once, a strict tree creates dead ends.
A common error is adding a filter because it is easy to build, not because the data is clean. Dirty attribute data produces filters that mislead. Fix the data, or leave the filter out.
How size and variety change the choice
The number of items matters a great deal.
- Under about 20 items. Show all of them. Search and filters add overhead without helping. A simple sorted list is often best.
- Dozens to a few hundred items. Filtering and sorting usually work well. Search helps if people know names.
- Thousands of items or more. Search becomes essential, because scanning and filtering alone take too many steps. Filters then refine the search results.
- Highly varied items. Browsing by category helps orient users. Different categories may need different filters, as a shoe filter set differs from a laptop filter set.
Treat these thresholds as rough guidance. Measure real behavior, which a later chapter covers.
Search versus filtering: the key differences
People confuse these two, so it helps to state how they differ in behavior.
| Aspect | Search | Filtering |
|---|---|---|
| Input | Free text | Selections from controls |
| Result set | Matches a query, usually ranked | Matches all constraints, often sorted |
| Failure mode | Typos or wrong words return nothing | Too many constraints return nothing |
| Visibility of options | Hidden. The user must guess terms. | Visible. The user sees what is possible. |
| Effort | Typing | Clicking or tapping |
| Order of results | Relevance | Usually user-chosen sort |
The visibility row matters most. Filters show what exists, so they teach the user about your catalog. Search hides it, so users depend on their own words. This is why filtering supports exploration while search supports retrieval.
Search also gives results a relevance order, which filtering does not. Filtered lists need a sort rule such as price or date. A later chapter on ranking and sorting covers this.
Combining the tools
Most real tasks use two or more tools in sequence. These patterns come up often.
- Search then filter. The user searches, then narrows the results. This is the standard pattern for large catalogs. The filters should apply to the current results, not reset the search.
- Browse then filter. The user enters a category, then narrows it. Category pages are effectively a search with a preset constraint.
- Filter then search within. The user restricts scope first, such as one folder or one project, then searches inside it. Email and file apps do this often.
- Search with suggestions that behave like browsing. Autocomplete can offer categories as well as terms, which gives vocabulary-poor users a way in.
The diagram below shows how these paths relate.
Notice the loops. Users move back and forth. A design that treats the tools as separate screens forces users to restart each time. A design that keeps one shared state, with the query, the category, and the filters together, lets them switch freely.
Keeping one source of truth
When tools combine, they must agree on a single description of what the user asked for. A simple model holds all three inputs.
type FindState = {
query: string; // search text, empty when not searching
category: string | null; // browse position, null means all
filters: Record<string, string[]>; // attribute name -> selected values
};
function describe(state: FindState): string {
const parts: string[] = [];
if (state.query) parts.push(`matching "${state.query}"`);
if (state.category) parts.push(`in ${state.category}`);
for (const [name, values] of Object.entries(state.filters)) {
if (values.length > 0) parts.push(`${name}: ${values.join(" or ")}`);
}
return parts.length > 0 ? `Showing items ${parts.join(", ")}` : "Showing all items";
}
console.log(describe({
query: "boots",
category: "Footwear",
filters: { size: ["42", "43"], color: ["black"] },
}));
// Showing items matching "boots", in Footwear, size: 42 or 43, color: blackThe describe function does real work in the interface. A plain-language summary of the current state tells users what they are looking at and why the list is the size it is. Later chapters show how to put this state in the URL so it can be shared and restored.
Common errors
- Search only. Users who can't name what they want get stuck, and a blank search box offers no clues.
- Filters only on a huge catalog. Users must click through many controls to reach an item they could have typed.
- Filters that discard the query. Applying a filter should keep the search. Losing it feels like a bug.
- Browsing that dead-ends. A category tree with no way to search or filter within it traps users who chose the wrong branch.
- Duplicated controls. Offering a "category" dropdown beside a category browse menu with different behavior confuses users. Make the two controls reflect the same state.
- Treating search as the default for everything. A search box is easy to add, but it can replace better structure. If most users search for the same few things, those things may belong in navigation.
A decision procedure
Use these steps when you design a new finding experience.
- List the top tasks users have, in their words.
- For each task, note what users know at the start: a name, some attributes, or only a general area.
- Check the data. Does it have searchable text, clean attributes, and a sensible grouping?
- Choose a lead tool for each task and a supporting tool for the hand-off.
- Define shared state so the tools combine without losing context.
- Test with real tasks, including ones where the user can't name the target.
The result is often a hybrid, such as a prominent search field, a visible category structure, and filters that refine whatever the user has on screen.
Exercise
A recipe app has 40,000 recipes. Users often say they want "something with chicken that takes under 30 minutes and is vegetarian-friendly side dishes only." Which tool should lead, which should support, and what must the app preserve when users switch between them?
Show answer
Search should lead for the ingredient ("chicken"), because the catalog is large and the user can name a keyword. Filtering should support, using structured attributes: total time under 30 minutes and a course such as "side dish." Browsing by category can serve users who have no keyword. The app must keep one shared state of query, category, and filters. Applying a filter must not clear the query, and the interface should summarize the active state, for example "Showing recipes matching 'chicken', time: under 30 minutes, course: side dish." Note that "vegetarian" conflicts with "chicken," so the interface should handle that contradiction gracefully, such as by showing an empty state with a suggestion to remove one constraint.
Exercise
A tool has a "color" filter with values "Navy", "navy blue", "dark blue", and "Blue". Which finding tool is affected, and what is the right response?
Show answer
Filtering is affected, because it depends on structured attributes with consistent values. The inconsistent values split matching items across several options, so users who pick one miss items under the others. The right response is to normalize the data, for example by mapping all four to one canonical value or a small set of defined values, before exposing the filter. Search can partly mask the problem but does not fix it.