1👍
✅
This happens because instance variables in the backend need to be reset before running rebuild_index
a second time.
from django.core import management
from haystack import connections
backend = connections['default'].get_backend()
backend.setup_complete = False
backend.existing_mapping = None
management.call_command('rebuild_index', interactive=False, verbosity=0)
Source:stackexchange.com