-
Notifications
You must be signed in to change notification settings - Fork 541
Clear cache while search using instantsearch.js #1050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello, sorry for late response, you should be able to clear the instantsearch cache by doing: // search being your instantsearch instance
search.client.clearCache(); Then when there's a new search on the IS interface, the cache will be cleared. Let me know if that works. |
Hello vvo, |
How is clearCache called for the new React components? |
That is not yet feasible, should be feasible this week we are gonna push a new update allowing you to do so |
@vvo I have a list of users. The list is populated using the Algolia searchBox connector. I'm wanting to refresh the index when a user is added or removed. Hope this helps explain my need. |
@shauntrennery Most probably what we will expose is this: import algoliasearch from 'algoliasearch';
var algoliaClient = algoliasearch(...);
const App = () => <InstantSearch algoliaClient={algoliaClient} />;
// ... later on:
// algoliaClient.clearCache(); Would that work for you? |
@vvo Any updates on clearing cache for the React Components? |
This is actually doable with the syntax above #1050 (comment). Just submitted a documentation update for the prop. |
hi, how can I do it with angular component? |
@tahminabs23, how are you using InstantSearch and Angular together? |
@Haroenv I am using the angular-instantsearch library. https://github.com/algolia/angular-instantsearch By the way, I have discovered that instantsearch.js has already implemented refresh() method, but angular-instantsearch library does not add this in their signature. So I have created another issue in angular-instantsearch library. algolia/angular-instantsearch#185 If they just update the InstantSearchInstance class, it can be easily fixed. We can easily call the refresh() method to refresh our result set. |
@vvo Vincent Voyer Hello I have a problem of disappearing data in the details of a product during the refresh |
Hi Bro,
is possible clear cache i am search every product
search is workig but old search product 2 or 3 product still showing .is possible clear cache clear-refinement wideget isn't used . |
Hi,
In our project we are using instantserach.js for search criteria.we have a problem with search i.e, when ever search happens that is not giving correct results for example in our page we are having Like and Unlike actions when ever the authenticated user Like an action the count will be increased and the action is changing as Unlike.we are using algolia with c# to update the index with respective changes.though the Index updated, results are not binding as expected.If we refresh the page then results are coming correctly.As per the documentation of algolia it is showing that each and every time in the search algolia won't hit API,the search will happen from cache.In our case also the thing is same, the results are getting from cache.I tried all the ways to clear cache as following but results are not coming.
var client = algoliasearch('applicationId', 'applicationkey');
var index = client.initIndex('indexname');
index.clearCache();
Please help us to clear the cache at every time search happens.
The text was updated successfully, but these errors were encountered: