-
Hi guys, I'm using instantsearch js version @4.57.0 and I have an instant search application which is integrated with some features that alter the hits of the table (through backend/serverside). As I update an object, I tried to apply "search.refresh()" in order to refresh the hits, however it does not return the updated data, while looking at the logs applying a refresh with a big delay it always brings the old data as well. I also tried to apply "search.clearCache()" and "search.client.clearCache()" as indicated on this issue, however it is returning "search.clearCache is not a function". It looks like it is a cache problem, as while I look at Algolia's dashboard the data is updated within few milliseconds. Does anyone has any possible guess how can I bring updated hits?
thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
all refresh does is clear the cache and search again: instantsearch/packages/instantsearch.js/src/lib/InstantSearch.ts Lines 834 to 843 in 6abc8f7 What I'm guessing is while the data updates quite fast in Algolia, it doesn't happen instantly. That means you probably do the table update, and refresh right away, before it's available in the search results. For solving that, you can add Oh and |
Beta Was this translation helpful? Give feedback.
-
@Haroenv thanks for your tips! Got it, I tried a timeout of more than 60s and the refresh did not bring updated hits, but if I do a simple browser refresh whit almost none delay the new search data is updated fine. Regarding using .wait() I guess that couldn't be used on my case, because the data is updated on backend (server side). Am I right? Thanks! |
Beta Was this translation helpful? Give feedback.
@Haroenv thanks for your tips!
Got it, I tried a timeout of more than 60s and the refresh did not bring updated hits, but if I do a simple browser refresh whit almost none delay the new search data is updated fine.
Regarding using .wait() I guess that couldn't be used on my case, because the data is updated on backend (server side). Am I right?
Thanks!