2014-11-05 8 views
3

我得到以下錯誤,我幾乎不知道從哪裏開始。我已閱讀,這可能是線程或別的東西,但在我的代碼存在的DocumentIndex只出現一次具有document作爲一種模式,沒有繼承它,並聲明是:如何在Django-Haystack中調試「Model <...>有多個SearchIndex處理它」錯誤?

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

的錯誤是:

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'. 
+0

full'class DocumentIndex' plz – 2014-11-05 13:18:13

回答

3

這是由於在haystack.utils的UnifiedIndex類中出現賽車情況。它應該在django-haystack 2.4中解決。

你可以閱讀關於它的所有信息here

嘗試使用search_view_factory,因爲它與傳統的SearchView不同,因爲它是線程安全的。

+0

直到版本2.5.1才顯然不固定。見https://github.com/django-haystack/django-haystack/commit/4e1e2e1c5df1ed1c5432b9d26fcb9dc1abab71f4 – 2016-12-20 04:07:17

相關問題