Commit 286ba91c authored by Sli's avatar Sli Committed by Skia

Adapt forum search to xapian and improve query

parent 9b8a8819
......@@ -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)
......
{{ object.topic }}
{{ object.title }}
{{ object.message }}
{{ object.author }}
......@@ -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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment