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
26924260
Commit
26924260
authored
Dec 10, 2018
by
Sli
Committed by
Skia
Dec 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forum: workaround for error while indexing badly encoded text (legacy)
parent
545671be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
core/search_indexes.py
core/search_indexes.py
+3
-1
No files found.
core/search_indexes.py
View file @
26924260
...
...
@@ -29,6 +29,8 @@ from haystack import indexes, signals
from
core.models
import
User
from
forum.models
import
ForumMessage
from
unicodedata
import
normalize
class
UserIndex
(
indexes
.
SearchIndex
,
indexes
.
Indexable
):
text
=
indexes
.
CharField
(
document
=
True
,
use_template
=
True
)
...
...
@@ -64,7 +66,7 @@ class BigCharFieldIndex(indexes.CharField):
"""
def
prepare
(
self
,
term
):
return
super
(
BigCharFieldIndex
,
self
).
prepare
(
term
)[:
245
]
return
normalize
(
"NFKC"
,
super
(
BigCharFieldIndex
,
self
).
prepare
(
term
)
)
[:
245
]
class
ForumMessageIndex
(
indexes
.
SearchIndex
,
indexes
.
Indexable
):
...
...
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