Show popular results when none are found

I am using React InstantSearch and currently have a “Sorry no results have been found” message that shows up when no results are found, but I would like to change this message to instead show my top results.

In the dashboard I have configured my hits to show the most popular first, so it seems I would essentially just want to show my Hits widget again when no results are found, but not sure how to get these results to show up when a query returns no results as currently nothing renders.

I have setup a codesandbox of the direction I am currently going in.

Hi there,

On the index in question you will want to adjust the “No results behavior” configuration. If you set it to “All optional” it will remove words one by one until results start to appear. If all words are removed it will show your default blank query ranking results.

You could also potentially create a rule to promote your most popular items.