has more than one SearchIndex handling it" in Django-Haystack? I am getting the following error and I have no idea wh...">

How to debug "Model <...> has more than one SearchIndex handling it" in Django-Haystack?

I am getting the following error and I have no idea where to start. I read that it could be threading or something else, but my code only has one occurrence DocumentIndex

that has document

as a model, nothing inherits from it, and the declaration is:

class DocumentIndex(indexes.SearchIndex, indexes.Indexable):

      

Mistake:

ImproperlyConfigured: Model '<class 'documents.models.Document'>' has more than one 'SearchIndex`` handling it. Please exclude either '<documents.search_indexes.DocumentIndex object at 0x8363a78>' or '<documents.search_indexes.DocumentIndex object at 0x83b1870>' using the 'EXCLUDED_INDEXES' setting defined in 'settings.HAYSTACK_CONNECTIONS'.

      

+3


source share


1 answer


This is due to the race condition occurring in the haystack.utils UnifiedIndex class. It should be resolved in django-haystack 2.4.

You can read all about it here .



Try using search_view_factory as it is thread safe unlike traditional SearchView.

+3


source







All Articles