InstantSearch vue (although probably a generic question!)

Is there a recommended method to provide the InstantSearch widget with a pre-collected set of initital results, rather than by default hitting the Algolia index?

My search is on the home page of my website. Like most websites, a good proportion of views on the default screen will “bounce”, ie the user immediately realises they’re in the wrong place and leaves. I don’t really want to pay for those searches, PLUS the default initial set of results needs to be the same for all users anyway, so can be part of the build.

I can see how to set the initial search state, but the code still hits the server as soon as the page loads.

Thanks for your help.

Hi there!

You can avoid triggering a query when users hits your homepage by proxying the search client, so that you can control when to trigger a query or not. We have a guide on how to do this in the Algolia documentation.

As you can see in this section, you can mock a request and return a static response. This is where you can define the default results set which will be served to your users without ever hitting Algolia.

Hope this helps!

Thanks, Sarah! That sounds like just what I needed to know.