Volodymyr
Volodymyr

Reputation: 1186

sunspot callback after_commit?

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

Answers (1)

iltempo
iltempo

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.

Upvotes: 1

Related Questions