Tatoeba/tatoeba2 — pull request #442 by jiru (2014-09-26 20:11:17+00:00)
Title: Faster search index refresh using delta index

This allows newly inserted sentences to be quickly found, using the delta index technique described in the [Sphinx documentation](http://sphinxsearch.com/docs/archives/manual-2.0.4.html#delta-updates).

As mentionned in #233, it isn’t as complete as it could, but it can already be used. The limitation is that we must recreate the main indexes once in a while, instead of being able to merge them with the delta ones little by little.

We need to setup a frequent delta index refresh (like an hour, possibly less) and a less frequent main index refresh (in a way that the delta doesn’t get too big). To run the refreshes, use the appropriate CakePHP shells:
```
./cake/console/cake -app app/ sphinx_indexes update main
./cake/console/cake -app app/ sphinx_indexes update delta
```

These should be run using the sphinxsearch user, so use the sphinxsearch user crontab or `sudo -u sphinxsearch` from root.

@trang Before pushing on production, you need to increase the maximum opened file limit for the Sphinx daemon. `sudo sed -i '/start-stop-daemon --start/i ulimit -n 2048' /etc/init.d/sphinxsearch` should do the trick. Also, don’t forget to run the database update script.