diff --git a/core/search_indexes.py b/core/search_indexes.py index 75dc262d..86401eed 100644 --- a/core/search_indexes.py +++ b/core/search_indexes.py @@ -99,7 +99,9 @@ class BigCharFieldIndex(indexes.CharField): """ def prepare(self, term): - return super(BigCharFieldIndex, self).prepare(term)[:240] + return bytes(super(BigCharFieldIndex, self).prepare(term), "utf-8")[ + :245 + ].decode("utf-8", errors="ignore") class ForumMessageIndex(indexes.SearchIndex, indexes.Indexable):