There may be instances where users enter a query for which you do not want to return results. While there is no out-the-box solution for forcing no results, you can simulate this behaviour using Algolia's Rules feature.
To do this, you can create a Manual Rule with the condition set to "query is/contains" and add the search term in question.
While there isn't a precise consequence to hide all results, there are a couple of options that will achieve the desired behaviour:
-
Add query parameter: add the
hitsPerPage
parameter and set value to 0
- Replace Query: Select a query that you know will return 0 results
Useful Guides: