X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/fa8909f95f314f1bea5f52b81381304c68a75417..9b6d232f7a8bc0ed1f9b090c06c8438db14e8179:/events/search_indexes.py?ds=sidebyside diff --git a/events/search_indexes.py b/events/search_indexes.py index 1321dcd..9977957 100644 --- a/events/search_indexes.py +++ b/events/search_indexes.py @@ -12,16 +12,15 @@ class EventIndex(indexes.RealTimeSearchIndex, indexes.Indexable): def index_queryset(self): """Used when the entire index for model is updated.""" return self.get_model().objects.all() - + add_translatable_index(EventIndex, { # Haystack needs a main field to be the same across all indexes # so we treat title of the event as this main content, named 'body' - 'body': indexes.CharField(model_attr='title'), - 'organizer': indexes.CharField(), - 'place': indexes.CharField() + 'body': indexes.CharField(model_attr='title', null=True), + 'organizer': indexes.CharField(null=True), + 'place': indexes.CharField(null=True) }) getattr(EventIndex, "body_%s" % settings.LANGUAGE_CODE).document = True -