InstantSearch implements the search-as-you-type pattern by default, which means it sends a request to Algolia on every keystroke. On plans billed per search request, that volume is what drives your cost.
Before changing anything, confirm which unit your plan bills on, see How Algolia counts search requests, operations, and records. The two levers below reduce requests. Reducing the number of queries bundled inside a single request lowers your operation count but not your request count, so on a current plan it produces no saving.
1. Bundle multi-index searches into one request
If your UI shows results from more than one index, check whether you're sending one network call per index or one bundled call for all of them. Searching three indices with three separate calls is billed as three requests; bundling them into a single multi-query call is billed as one.
To check: open your browser's developer tools and watch the Network tab as you type.
- A call to
querymeans one request went to one index. - A call to
queriesmeans two or more queries were grouped into a single network request.
If you have a multi-index implementation and you're seeing several query lines per keystroke rather than one queries line, this is where your saving is.
2. Debounce keystrokes
You can delay sending a request until the user has typed a minimum number of characters, or until they briefly stop typing. Rather than writing this yourself, use the maintained guide for your flavour:
See also conditional requests, for suppressing requests you don't need at all — for example the empty-query search fired on page load when no Algolia results are displayed yet: JS, React, Vue, iOS, Android.
A caveat on debouncing: waiting for more characters can make search feel laggy, since the point of search-as-you-type is immediate feedback. If you introduce a threshold, show placeholder or default content in the meantime rather than an empty results area.
3. Audit what else is sending requests
Beyond the search box itself, check for:
- Redundant page-load queries. Clear your cache and reload. If a request fires but no Algolia results are visible on the page, you may be able to remove it.
- Duplicate queries to the same index, or queries to indices you aren't displaying.
-
Widgets that send two requests per interaction.
refinementListmakes one search for refinement counts and one for results.dynamicWidgetscan add an extra query. - Bot traffic. See How do I prevent or reduce bot traffic in Algolia Search? and Why is it important to create a rate limited API Key?
The full checklist, including what healthy usage growth looks like, is in Optimize search request usage.