- Feature specific data from within your records to, for example, show promotional prices during a sales period
- Display advertisements or promotional banners.
To learn how to suppress InstantSearch’s initial search query, check out the conditional requests guide.
Handling no results
Since not all queries lead to results, it’s essential to let users know when this happens by providing hints on how to adjust the query.Display a message
The easiest way to display a fallback message when a query doesn’t return results is to subscribe to theSearcher
’s response
event and show your “no results” UI whenever the response has no hits
.
Kotlin
Handling empty queries
By default, InstantSearch always shows you results, even when the query is empty. Depending on your use case and how you build your UI, you may only want to show results when there’s a query. To override this behavior, you can implement your ownSearchBoxView
. Instead of calling onQueryChanged
or onQuerySubmitted
for every query, you can call them only when the query isn’t empty.
Kotlin
Handling errors
If an error occurs, you can display a specific piece of content to help users return to the standard state. Subscribe to theSearcher
’s error
event to be notified of errors.
Kotlin