diff --git a/core/middleware.py b/core/middleware.py index d6479009..37c01ff9 100644 --- a/core/middleware.py +++ b/core/middleware.py @@ -27,7 +27,7 @@ from django.conf import settings from django.utils.functional import SimpleLazyObject from django.contrib.auth import get_user from django.contrib.auth.middleware import ( - AuthenticationMiddleware as DjangoAuthenticationMiddleware + AuthenticationMiddleware as DjangoAuthenticationMiddleware, ) module, klass = settings.AUTH_ANONYMOUS_MODEL.rsplit(".", 1) diff --git a/core/templates/search/indexes/forum/forummessage_text.txt b/core/templates/search/indexes/forum/forummessage_text.txt index 2df962ae..c74419ce 100644 --- a/core/templates/search/indexes/forum/forummessage_text.txt +++ b/core/templates/search/indexes/forum/forummessage_text.txt @@ -1 +1,4 @@ +{{ object.topic }} +{{ object.title }} {{ object.message }} +{{ object.author }} diff --git a/forum/views.py b/forum/views.py index d0296016..44352f17 100644 --- a/forum/views.py +++ b/forum/views.py @@ -47,7 +47,7 @@ class ForumSearchView(ListView): def get_queryset(self): query = self.request.GET.get("query", "") - q = SearchQuerySet().models(ForumMessage).filter(text=query) + q = SearchQuerySet().models(ForumMessage).filter_or(text__contains=query) return [r.object for r in q]