I need run ts:reindex when smth add in model or destroy from model. How should I do this?
- Write cron job (for example run every hour).
- I tried add ts:reindex in model callbacks, but this does not work for me.
- Or is there a common way to solve this problem?
Using:
thinking-sphinx (2.0.11)
rails (3.1.3)
Take a look at deltas. You can read about them there http://freelancing-god.github.com/ts/en/deltas.html
Cron job is an option also, but deltas much better, they simulate real-time index.