Closed eugenevk closed 3 years ago
the search results are indeed cached for performance (and to save you costs) by the search client. You can either disable the cache in algoliasearch: https://www.algolia.com/doc/api-client/advanced/configure-the-client/javascript/?client=javascript#cache-on-requests-and-responses
Or you can refresh the search cache periodically, or based on a button. For that you can use instantSearchInstance.refresh()
(the InstantSearch instance is available to be injected to any child of the ais-instant-search component)
Thanks @Haroenv, that clarifies. You can close this ticket.
https://www.algolia.com/doc/guides/building-search-ui/going-further/improve-performance/vue/#caching is the refresh guide for Vue InstantSearch by the way :)
Bug 🐞 In my project I am using VueJS 3.2.20 (Composition API), Vue CLI 4.5.14, plus Firebase, plus Algolia, and vue-instantsearch. I noticed that when I launch my app and go to my instantsearch page, the records initially shown are according to what is in the Algolia index. Example of the search page in my app:
In Algolia:
If I now add a record via my app, it gets added to Algolia correctly:
but when I navigate back to the search page, the instantsearch view doesn't get updated in my app:
But I can search for the new record correctly:
I need to refresh my browser to get the initial instantsearch view updated to show all available records:
It looks like the records for the initial instantsearch view are cached or so. How can I get this updated in real-time?