views:

38

answers:

1

I'm trying to figure out how I should be reindexing Sphinx. I'm using v 0.9.9, so I don't have the ability to do real-time updates of the index.

I think I read somewhere that this can be done using a cron job, and that the index does not need to be entirely rebuilt (so no stopping the daemon). That said, I've never written nor run any cron jobs, so no idea where to even start.

Any thoughts?

A: 

I think what you're after is a main+delta index. The main index you build say once a day then every 5 minutes (or whatever period you need) you'd update it with changes since the last time it built. There is something in the docs that explains this and there are also posts on Google about this as well.

http://sphinxsearch.com/docs/current.html#delta-updates

In terms of the cronjob to rebuild your delta every 5 minutes you'd want something like:

*/5 * * * * /opt/sphinx/bin/indexer -c /opt/sphinx/etc/sphinx.conf --rotate delta_idx
Ian