Adapt forum search to xapian and improve query

This commit is contained in:
2018-12-05 14:05:47 +01:00
committed by Skia
parent 9b8a881914
commit 286ba91c75
3 changed files with 5 additions and 2 deletions

View File

@ -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]