From: Radek Czajka Date: Mon, 31 Mar 2014 14:51:10 +0000 (+0200) Subject: Haystack 2 compatibility. X-Git-Url: https://git.mdrn.pl/prawokultury.git/commitdiff_plain/00f9b1d3f474c595b381a3064988e442122b59be?ds=sidebyside;hp=b4491cb6f55169a95ce98ea67065ea6878618416 Haystack 2 compatibility. --- diff --git a/events/search_indexes.py b/events/search_indexes.py index ec33c99..2445da6 100644 --- a/events/search_indexes.py +++ b/events/search_indexes.py @@ -5,7 +5,7 @@ from fnpdjango.utils.models.translation import add_translatable_index, localize_ from events.models import Event -class EventIndex(indexes.RealTimeSearchIndex, indexes.Indexable): +class EventIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(null=True, model_attr=localize_field('title', settings.LANGUAGE_CODE), document=True) diff --git a/prawokultury/settings.d/35-search.py b/prawokultury/settings.d/35-search.py index 3f2c932..78453e2 100644 --- a/prawokultury/settings.d/35-search.py +++ b/prawokultury/settings.d/35-search.py @@ -6,3 +6,4 @@ HAYSTACK_CONNECTIONS = { } HAYSTACK_DOCUMENT_FIELD = "text" +HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' diff --git a/questions/search_indexes.py b/questions/search_indexes.py index ff49250..ae126f0 100755 --- a/questions/search_indexes.py +++ b/questions/search_indexes.py @@ -4,7 +4,7 @@ from haystack import indexes from .models import Question -class QuestionIndex(indexes.RealTimeSearchIndex, indexes.Indexable): +class QuestionIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True) answer = indexes.CharField(model_attr="answer")