mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
forum: workaround for building index with safety margin
This commit is contained in:
parent
269242601a
commit
ee99ec1aed
@ -29,8 +29,6 @@ from haystack import indexes, signals
|
|||||||
from core.models import User
|
from core.models import User
|
||||||
from forum.models import ForumMessage
|
from forum.models import ForumMessage
|
||||||
|
|
||||||
from unicodedata import normalize
|
|
||||||
|
|
||||||
|
|
||||||
class UserIndex(indexes.SearchIndex, indexes.Indexable):
|
class UserIndex(indexes.SearchIndex, indexes.Indexable):
|
||||||
text = indexes.CharField(document=True, use_template=True)
|
text = indexes.CharField(document=True, use_template=True)
|
||||||
@ -66,7 +64,7 @@ class BigCharFieldIndex(indexes.CharField):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def prepare(self, term):
|
def prepare(self, term):
|
||||||
return normalize("NFKC", super(BigCharFieldIndex, self).prepare(term))[:245]
|
return super(BigCharFieldIndex, self).prepare(term)[:240]
|
||||||
|
|
||||||
|
|
||||||
class ForumMessageIndex(indexes.SearchIndex, indexes.Indexable):
|
class ForumMessageIndex(indexes.SearchIndex, indexes.Indexable):
|
||||||
|
Loading…
Reference in New Issue
Block a user