X-Git-Url: https://git.mdrn.pl/django-migdal.git/blobdiff_plain/4215649b2a31947ef75b899553577746280b6e8e..2c99167266c1be5545880dc2ee2b1a0c741fddc7:/migdal/search_indexes.py?ds=sidebyside diff --git a/migdal/search_indexes.py b/migdal/search_indexes.py index 5e3f7d4..7c2ba7f 100644 --- a/migdal/search_indexes.py +++ b/migdal/search_indexes.py @@ -1,12 +1,16 @@ -import datetime +# -*- coding: utf-8 -*- +# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf import settings from haystack import indexes from fnpdjango.utils.models.translation import add_translatable_index, localize_field from migdal.models import Entry -class EntryIndex(indexes.RealTimeSearchIndex, indexes.Indexable): - text = indexes.CharField(null=True, +class EntryIndex(indexes.SearchIndex, indexes.Indexable): + text = indexes.CharField( + null=True, model_attr=localize_field('body', settings.LANGUAGE_CODE), document=True) date = indexes.DateTimeField(indexed=True, model_attr="date")