This is not something you can do ootb with the SearchResults component. I think you have a few options to achieve the functionality:
- Use the SearchResults component and add some custom JavaScript to your page that counts the results and hides the results and displays a text if needed - this places your logic in the browser and I'm not sure if it's that easy to get a good user experience this way (but I'm no js expert)
- Write a custom rule that checks the count and use that with personalization to show the desired component - this will work fine but in case of few results you will have done the query twice
- Write a custom Scriban extension to do your query and check the count (https://ggullentops.blogspot.com/2019/11/custom-sxa-scriban-extensions.html) Use that output to show a different component from within your Scriban template.
- Go fully custom.. write the query, check the output and display either a text or the results - you can use variants with your own components (https://ggullentops.blogspot.com/2017/03/variants-sxa-sitecore-rendering.html) and also make the component compatible with pagination (https://ggullentops.blogspot.com/2018/12/sxa-pagination-on-custom-component.html)
- Use the SearchResults component and add some custom JavaScript to your page that counts the results and hides the results and displays a text if needed - this places your logic in the browser and I'm not sure if it's that easy to get a good user experience this way (but I'm no js expert)
- Write a custom rule that checks the count and use that with personalization to show the desired component - this will work fine but in case of few results you will have done the query twice
- Write a custom Scriban extension to do your query and check the count (https://ggullentops.blogspot.com/2019/11/custom-sxa-scriban-extensions.html) Use that output to show a different component from within your Scriban template.
- Go fully custom.. write the query, check the output and display either a text or the results - you can use variants with your own components (https://ggullentops.blogspot.com/2017/03/variants-sxa-sitecore-rendering.html) and also make the component compatible with pagination (https://ggullentops.blogspot.com/2018/12/sxa-pagination-on-custom-component.html)
I think I would go for option 3 or 4...