Skip to content
Bugwise
Menu
Features & Flows

Search, Filters and Sorting

How search, filters and sorting work behind the scenes, where they usually break, and how to test them on websites and mobile apps, with a hands-on bug hunt in a broken shop.

40–60 min beginner Mobile & web

You type “running shoes” into a shopping app, tap Men, tap Under $100, sort by Top rated, and expect a tidy list of exactly what you asked for. You do this in shops, food delivery apps, banking transaction lists, travel sites and music players, often dozens of times a day.

Because people use search constantly, they notice instantly when it’s wrong: a missing product, a count that doesn’t add up, a price list in a strange order. And a shopper who can’t find a product can’t buy it. Search bugs cost real money. Let’s learn how these features work and how testers break them.

Part Not started

How it works

Search, filters and sorting are three separate features that work together on one results screen.

Search: from query to results

  1. The user types a query. For example mug. Many apps start searching while you type (“search as you type”); others wait for the Search key or button.
  2. The app waits a moment (debounce). A good app doesn’t send a request on every keystroke. It waits until you pause typing for around 200–500 ms. This is called a debounceDebounceWaiting until the user stops typing for a moment before reacting, for example before searching.Open in glossary →.
  3. The app sends a request. It asks the server for matching products through the server’s APIAPIThe way different software parts talk to each other, like an app asking a server for data.Open in glossary →. The active filters and the sort order usually travel in the same request.
    Dev note
    Something like GET /api/search?q=mug&cat=kitchen&sort=price_asc.
  4. The server finds matches. It first cleans up the query (trims spaces, ignores upper/lower case, often ignores accents like é), then ranks the results by relevance: the best matches come first.
  5. The app shows the results. It shows a loading stateLoading stateWhat the UI shows while it waits for data or an action to finish, such as a spinner or skeleton.Open in glossary → while waiting, then the results, a results count and the matched words highlighted. If nothing matches, it shows an empty stateEmpty stateThe screen a user sees when there is no content yet, like an empty cart or no search results.Open in glossary → with a helpful message.
  6. More results load on demand. Long lists are split into pages: numbered pagination (“Page 2 of 8”) or infinite scrollInfinite scrollLoading more items automatically when the user reaches the bottom of a list.Open in glossary → (the next batch loads as you reach the bottom).

Extra helpers you’ll often meet:

See for yourself why debouncing matters. Type quickly with the debounce on, then turn it off and try again:

Try it: type “wireless earbuds” quickly

Keystrokes

0

Requests sent

0

Network log

  • No requests yet…

Filters: narrowing the list

Filters let the user narrow results by attributes: category, price range, size, rating, availability.

Filter typeLooks likeExample
ChipsSmall pill buttons you tap on and offKitchen, In stock, 4★ & up
CheckboxesA list in a side panel, or on phones in a bottom sheet (a panel that slides up from the bottom)Brand: ☐ Nike ☐ Adidas ☐ Puma
RangeA slider with two handles, or min/max fieldsPrice: $20 – $100
Single choiceRadio buttonsRadio buttonA round option in a group where exactly one can be selected; choosing one unselects the others.Open in glossary → or a dropdownDelivery: Today / This week
ToggleA switchFree shipping only

Things every filter UI should have:

  • A filter count badge, like Filters (3), so the user knows filters are active even when the panel is closed.
  • Clear all to remove every filter at once, and a way to remove a single filter (often an × on the chip).
  • An updated results count after every change.

Sorting: putting results in order

Sorting changes the order, never the set of results. The count must stay the same when you change the sort.

Sort optionCorrect orderWatch out for
Relevance (default)Best match firstExact matches should beat partial ones
Price: low to high$5.49, $8.99, $12.50, $100Sorting prices as text gives $100 before $12.50
Price: high to lowThe reverseSale prices vs. original prices: which one is used?
Top rated4.9 before 4.1Products with 1 review of 5★ ranking above 2,000 reviews of 4.8★
NewestMost recently added firstTime zones and items with the same date

Ties happen all the time: two products cost $19.99. A good sort is stable: items that tie keep a consistent order (for example, by relevance), so they don’t jump around every time you reload or load the next page. Unstable ties can even cause a product to appear on page 1 and page 2, while another product never appears at all.

URL state on the web

On a website, the current search, filters and sort should live in the address bar:

shop.example.com/search?q=mug&cat=kitchen&sort=price_asc

Everything after the ? is a list of query parametersQuery parameterData in a URL after the ?, like ?q=mug&sort=price, often used to keep search and filter state.Open in glossary →, name=value pairs joined by &: here the query (q), the category (cat) and the sort order (sort). The names differ from site to site, but you can read them without any tools.

This gives users three important things:

  • Shareable links: paste the URL to a friend and they see the same results.
  • Back button works: open a product, press Back, and you return to the same filtered list, ideally at the same scroll position.
  • Refresh keeps state: reloading the page doesn’t wipe your filters.

Mobile apps don’t have an address bar, but the same idea applies: going back from a product should keep your query, filters, sort and scroll position. Some apps also support deep linksDeep linkA link that opens a specific screen inside an app instead of just its home screen.Open in glossary → that open a pre-filtered search.

Example requirements

Notice how testable each line is. Criterion 7 alone gives you a check to run after every other test. Learn more in acceptance criteriaAcceptance criteriaConditions a user story must meet to be considered done and accepted.Open in glossary → and user storyUser storyA short description of a feature from the user's point of view.Open in glossary →.

Check this part

  1. You select the "Kitchen" and "Home" category chips. What should usually happen to the number of results?

  2. You change the sort from Relevance to Price: low to high. What should happen to the results count?

  3. Why should search filters and sort be stored in the URL on a website?

How a query becomes results, how filters combine, how sorting works, why state belongs in the URL, and the requirements.

Part Not started

What usually goes wrong

The severity column shows a typical rating, not a fixed one: how bad a bug is depends on the product (Severity vs priority explains how to rate it).

#BugWhat you seeTypical severity
1Out-of-order responsesYou typed “mug” but see results for “m”, usually after typing fastHigh
2Strict text matching“cafe” doesn’t find “Café”, “Mug” finds things “mug” doesn’t, “mugs” finds nothingMedium–High
3Wrong results count“24 results” above a list of 9 productsMedium
4Clear all only clears the UIChips look unselected, but the list is still filteredHigh
5Text sorting of numbers$100 listed before $12.50 when sorting low to highHigh
6Missing empty stateBlank screen or a spinner that never stops when nothing matchesMedium
7Filter and search ignore each otherApplying a filter clears the query, or a new search drops the filtersHigh
8Wrong AND/OR logicSelecting two categories shows fewer results instead of moreHigh
9Lost state on BackReturning from a product resets filters and scrolls to the topMedium
10Pagination duplicatesThe same product appears on page 1 and page 2, or one never appearsMedium
11Unsafe input handlingSpecial characters like ' or < cause an error page or break the layoutHigh (security)
12Request floodEvery keystroke sends a request, slowing the app and the serverLow–Medium

Find the bug

The home goods shop below has a search page with six bugs. Explore it like a real tester:

  • Type slowly, then type quickly, and watch the network log under the shop (it lists every request the page sends and every answer it gets).
  • Search for words with and without accents.
  • Turn filters on, combine them, then press Clear all.
  • Try every sort option and check the prices.
  • Search for something that doesn’t exist.
  • Compare the results count with what you can actually see.

🐞 Bug hunt: Nook & Co. shop search

This demo has 6 hidden bugs. Explore it like a tester, then check your findings.

Found0/6
nookandco.shop/search

Nook & Co.

Home goods & more
Filters

18 results

  • Stoneware Coffee Mug4.6Kitchen$12.50
  • Café Espresso Beans 1 kg4.8Kitchen$24.99
  • Cafe Bistro Chair4.1Home$129.00
  • Travel Mug with Lid4.3OutdoorOut of stock$19.00
  • Linen Table Lamp3.9Home$64.00
  • Camping Lantern4.5Outdoor$39.00
  • Wireless Earbuds4.2Tech$89.00
  • Crème Brûlée Torch4.0Kitchen$32.00
  • Wool Throw Blanket4.7Home$45.00
  • Two-Person Tent4.4Outdoor$249.00
  • USB-C Charging Cable3.6Tech$9.99
  • Ceramic Mug Set (4)4.9Kitchen$100.00
  • Scented Candle4.1HomeOut of stock$8.99
  • Bluetooth Speaker4.6Tech$110.00
  • Insulated Water Bottle4.4Outdoor$18.00
  • Silicone Spatula3.8Kitchen$5.49
  • Desk Lamp with USB Port4.0Tech$15.00
  • Pour-Over Coffee Maker4.3Kitchen$7.50

Network log

  • Type in the search box to see API requests…
  1. 1

    Hint: Type "lamp" as fast as you can and watch the network log.

  2. 2

    Hint: Search for "cafe", then for "café".

  3. 3

    Hint: Turn on "4★ & up" and count the products.

  4. 4

    Hint: Select Tech, then press Clear all.

  5. 5

    Hint: Sort by "Price: low to high" and read the prices top to bottom.

  6. 6

    Hint: Search for something the shop doesn't sell, like "piano".

Check this part

  1. You type "mug" quickly. The box says "mug", but the list shows products containing "m". What is the most likely cause?

  2. Sorted by "Price: low to high", the list shows $100, $110, $12.50, $129, $15. What is the bug?

The search, filter and sort bugs teams ship again and again, and a broken shop search to find them in.

Part Not started

Test scenarios

Group your ideas so you don’t forget whole areas. A test scenarioTest scenarioA high-level idea of what to test, such as 'User resets a forgotten password'.Open in glossary → is what to check; you’ll turn the important ones into test cases next.

Functional

  • Search by a full product name, a partial word (“lam” finds “Lamp”) and a word from the middle of a name.
  • Search is triggered by typing (after the debounce), by the Search/Enter key and by the search button.
  • Each filter on its own narrows the list correctly.
  • Two values in one group (OR) make the list bigger; filters from different groups (AND) make it smaller.
  • Search and filters work together: changing one keeps the other.
  • Each sort option orders the list correctly, and the results count doesn’t change when sorting.
  • Ties are stable: products with the same price keep the same order after reload and across pages.
  • Results count is correct after every search, filter and sort change.
  • PaginationPaginationSplitting a long list into pages that load one at a time.Open in glossary → or infinite scroll: no duplicates, no gaps, the last page ends cleanly.
  • Autocomplete suggestions match the query and tapping one runs the search.
  • Recent searches are saved, shown in the right order (newest first), and can be removed one by one or all at once.
  • Web: URL updates; Back, Forward, refresh and a shared link restore the same state.

Negative and edge cases

This is where negative testingNegative testingTesting with invalid or unexpected input to check the software handles it gracefully.Open in glossary → and edge casesEdge caseAn unusual situation at the extreme of what the software should handle.Open in glossary → shine. Try each of these queries:

QueryWhat to check
(empty)Pressing Search does nothing, or shows all products or recent searches. Never an error
" " (only spaces)Treated like an empty query. Not “No results for ’ ’”
" mug "Leading/trailing spaces are ignored; finds the same as mug
MUG, Mug, mUgSame results as mug (case-insensitive)
cafe vs caféSame results (accents, called diacriticsDiacriticsAccent marks on letters, like é, ü, č or ž. Search usually should ignore them.Open in glossary →, are ignored)
mugs vs mugPlurals ideally find the same products
mgu, headphnesTypos: “Did you mean…?” or fuzzy matches, at least a friendly empty state
%, &, _, #, +No error; the character is searched literally. (In many databases % and _ are wildcards that mean “any text”, so a careless search for % returns everything)
' or "No error page. A crash here can hint at SQL injectionSQL injectionAn attack where text typed into a field is run as a database command.Open in glossary →: the query is being run as a database command instead of treated as text
<b>hi</b>Shown as plain text, exactly as typed, never as a bold hi. If it turns bold, the page treats input as HTML, a sign of Cross-site scripting (XSS)Cross-site scripting (XSS)An attack where text a user enters is run as code in other people's browsers.Open in glossary → risk
300+ charactersThe field limits the input or handles it; the layout doesn’t break; no server error
Emoji ☕ and non-Latin text кофеNo crash; sensible results or empty state
A price range where min > maxPrevented or swapped, with a clear message
Filters that match nothingEmpty state that suggests removing filters

UI and usability

Performance

  • Results appear within the agreed time (for example, under 1 second on a normal connection).
  • Typing fast doesn’t send a request for every keystroke (count the requests in the DevTools Network tab).
  • Old requests are canceled or ignored, so results never flicker between queries.
  • Scrolling a long list (hundreds of items, infinite scroll) stays smooth.
  • On a slow or offline connection, the app shows a loading state and then an error message, not a frozen screen.

Accessibility

Check this part

  1. Which query is the best check for accent handling?

  2. You search for <b>hi</b> and the results page shows the word hi in bold. Why does that matter?

What to check: functional, tricky queries, UI, performance and accessibility.

Part ProNot started

Example test cases

These cases are written for the Nook & Co. shop from the bug hunt, so the product names and prices are known. That’s the point of a precondition like “Catalog contains…”: without known test dataTest dataThe input values, accounts and records you use while testing.Open in glossary → you can’t write an exact expected result. TC-SRCH-003 slows the connection down on purpose (network throttlingNetwork throttlingDeliberately slowing the connection to test how an app behaves on poor networks.Open in glossary →): in Chrome, open DevTools, go to the Network tab and pick Slow 4G from the throttling menu. Every other case needs only the browser. New to the format? See How to Write Test Cases.

TC-SRCH-001Search by partial product name

Preconditions

  • Catalog contains "Linen Table Lamp" and "Desk Lamp with USB Port"

Steps

  1. Open the search page
  2. Type "lamp"
  3. Wait 1 second

Test data

Query: lamp

Expected result

Exactly the two lamp products are shown, "lamp" is highlighted in each name, and the count says "2 results for 'lamp'".

TC-SRCH-002Search ignores case, spaces and accents

Steps

  1. Search for "cafe"
  2. Note the results
  3. Search for " CAFÉ "

Expected result

Both searches return the same products, including "Café Espresso Beans" and "Cafe Bistro Chair".

TC-SRCH-003Fast typing shows results for the final query only

Preconditions

  • Network throttled to "Slow 4G" in DevTools

Steps

  1. Type "lamp" as fast as possible
  2. Wait 3 seconds without typing

Expected result

Only lamp products are shown. At most one or two requests appear in the network tab, and the list never switches to results for "l" or "la".

TC-SRCH-004No results shows a helpful empty state

Steps

  1. Search for "piano"

Expected result

The loading indicator disappears and the page shows "No results for 'piano'" with a tip to check spelling or remove filters.

TC-SRCH-005Filters in different groups combine with AND

Steps

  1. Tap "Kitchen"
  2. Note the count
  3. Tap "4★ & up"

Expected result

The list shows only Kitchen products rated 4.0 or higher, and the count shrinks to match the number of visible products.

TC-SRCH-006Clear all removes every filter from the results

Steps

  1. Tap "Tech" and "In stock"
  2. Tap "Clear all"

Expected result

All chips are unselected, the filter badge disappears and all products are shown with the full count.

TC-SRCH-007Price sort is numeric

Steps

  1. Select sort "Price: low to high"
  2. Read prices from top to bottom
  3. Select "Price: high to low"

Expected result

Low to high starts with $5.49 and ends with $249.00, each price ≥ the one above. High to low is the exact reverse. The count does not change.

TC-SRCH-008Back button restores search state (web)

Steps

  1. Search "mug", tap "Kitchen", sort by "Top rated"
  2. Open any product
  3. Press the browser Back button

Expected result

The URL, query, chip, sort and results are the same as before opening the product, and the scroll position is kept.

TC-SRCH-009Special characters are handled safely

Steps

  1. Search for each: ' " % _ <b>x</b>

Expected result

No error page or broken layout. The query is shown as plain text in the empty state or results.

Tip: click a test case to expand it.

Check this part

  1. In the Clear all test case, what proves that the filters are really gone?

  2. In the fast typing test case, what should the network tab show?

Search, filter and sort test cases with exact steps and expected results.

The rest of this lesson is in Bugwise Pro

The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.

Part ProNot started

Mobile vs web

Check this part

  1. On mobile, you change filters in a bottom sheet and close it without tapping Apply. What should happen?

  2. On the web, you're on page 3 and change a filter. Where should you usually land?

Search keys, bottom sheets, infinite scroll and app state on mobile; URL state, the Network tab and pagination on the web.

The rest of this lesson is in Bugwise Pro

The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.

Checklist

Search, filters and sorting checklist

0 of 18 checked

Key takeaways

  • Search flows from query → debounce → request → results, with loading, empty and error states along the way.
  • The nastiest search bug is the race condition: type fast on a slow network and check you see results for the final query.
  • Test queries with case, spaces, accents, plurals, typos, special characters and extreme lengths.
  • Filters: OR within a group, AND between groups. Check the badge, Clear all, and that search and filters keep each other.
  • Sorting changes the order, never the set. Check numeric price sorting and stable ties.
  • After every action, check that the results count matches the list.
  • On the web, state belongs in the URL; on mobile, it must survive Back, rotation and backgrounding.

Finished this page?Nice work, this page is complete!

Mark it as done to track your progress. It's saved in this browser, no account needed.

Its cards are now in your Bites review ⚡
Esc

Type to search the whole site.