How do I automatically rebuild the Sphinx index under django-sphinx?

Posted by Apreche on Stack Overflow See other posts from Stack Overflow or by Apreche
Published on 2009-10-31T01:18:27Z Indexed on 2010/04/17 2:53 UTC
Read the original article Hit count: 400

Filed under:
|
|
|
|

I just setup django-sphinx, and it is working beautifully. I am now able to search my model and get amazing results. The one problem is that I have to build the index by hand using the indexer command. That means every time I add new content, I have to manually hit the command line to rebuild the search index. That is just not acceptable.

I could make a cron job that automatically runs the indexer command every so often, but that's far from optimal. New data won't be indexed until the cron runs again. In addition, the indexer will run unnecessarily most times as my site doesn't have data being added very often.

How do I set it up so that the Sphinx index will automatically rebuild itself whenever data is added to or modified in a searchable django model?

© Stack Overflow or respective owner

Related posts about django

Related posts about sphinx