Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
545671be
Commit
545671be
authored
Dec 07, 2018
by
Sli
Committed by
Skia
Dec 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forum: workaround for building index
parent
347caa3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
core/search_indexes.py
core/search_indexes.py
+11
-1
No files found.
core/search_indexes.py
View file @
545671be
...
...
@@ -57,8 +57,18 @@ class UserOnlySignalProcessor(signals.BaseSignalProcessor):
models
.
signals
.
post_delete
.
disconnect
(
self
.
handle_delete
,
sender
=
User
)
class
BigCharFieldIndex
(
indexes
.
CharField
):
"""
Workaround to avoid xapian.InvalidArgument: Term too long (> 245)
See https://groups.google.com/forum/#!topic/django-haystack/hRJKcPNPXqw/discussion
"""
def
prepare
(
self
,
term
):
return
super
(
BigCharFieldIndex
,
self
).
prepare
(
term
)[:
245
]
class
ForumMessageIndex
(
indexes
.
SearchIndex
,
indexes
.
Indexable
):
text
=
indexes
.
CharField
(
document
=
True
,
use_template
=
True
)
text
=
Big
CharField
Index
(
document
=
True
,
use_template
=
True
)
auto
=
indexes
.
EdgeNgramField
(
use_template
=
True
)
def
get_model
(
self
):
...
...
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