Skip to main content
Starting May 1, 2024, Apple requires all iOS apps to include a privacy manifest. For more information, see Privacy manifest.
This guide describes what to do when there are no results, when there’s no query, or when there are errors. If results haven’t loaded, the search may still be in progress or the device may be offline. For more information, see No hits or is the search still in progress? If you want to feature content in your search results based on a set of conditions, you can use Algolia Rules to:
To learn how to suppress InstantSearch’s initial search query, see Conditional requests.

Handle searches without results

When a query doesn’t return results, display a message and suggest changing the query or clearing filters.

Display a message

To display a fallback message when a query doesn’t return results, use the Searcher’s onResponse event and show your “no results” UI`.
Swift

Handle empty queries

By default, InstantSearch sends search requests 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. The Hits widget exposes a showItemsOnEmptyQuery property in the HitsInteractor’s initializer, which defaults to true. When set to false, the widget doesn’t present hits if the query is empty.
Swift

Handle search errors

If an error occurs, you can display a specific piece of content to help users return to the standard state. To be notified of errors, subscribe to the Searcher’s onError event.
Swift
Last modified on October 8, 2026