Reputation: 1186
Can anybody suggest is it possible with sunspot to have a callback like after_commit or after reindex.
I want cache facets in user session and reload them when something changed. Is it possible?
Upvotes: 0
Views: 388
Reputation: 16012
If you are using ActiveRecord you may hook into after_save of your Model instead of hooking into sunspot. It does the same. Just ensure you are defining the hook after the searchable definition to get re-indexed data from Solr.
ActiveRecord
after_save
searchable
Upvotes: 1