Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
286ba91c
Commit
286ba91c
authored
Dec 05, 2018
by
Sli
Committed by
Skia
Dec 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt forum search to xapian and improve query
parent
9b8a8819
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
core/middleware.py
core/middleware.py
+1
-1
core/templates/search/indexes/forum/forummessage_text.txt
core/templates/search/indexes/forum/forummessage_text.txt
+3
-0
forum/views.py
forum/views.py
+1
-1
No files found.
core/middleware.py
View file @
286ba91c
...
...
@@ -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
)
...
...
core/templates/search/indexes/forum/forummessage_text.txt
View file @
286ba91c
{{ object.topic }}
{{ object.title }}
{{ object.message }}
{{ object.author }}
forum/views.py
View file @
286ba91c
...
...
@@ -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
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment