简体   繁体   中英

Rails and thinking_sphinx when I should do reindex?

I need run ts:reindex when smth add in model or destroy from model. How should I do this?

  1. Write cron job (for example run every hour).
  2. I tried add ts:reindex in model callbacks, but this does not work for me.
  3. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM