[Django]-Django-Haystack + Whoosh – empty index after rebuild_index

6👍

I am betting that you have Wagtail installed in your project as well – because that is where the Backend doesn’t require rebuild is coming from.

The problem is that Wagtail defines its own update_index management command which conflicts with the one that Haystack has (rebuild_index calls update_index). When you try to rebuild your index, the Wagtail command is being called instead of the Haystack one.

The quick and dirty solution is to make sure that haystack comes after wagtail in INSTALLED_APPS – its commands will be loaded last and will replace the Wagtail ones.

Alternative you need to write your own management command that wraps Haystack’s rebuild_index code.

Leave a comment