Last active
August 29, 2015 14:16
-
-
Save martinsam/2366cea76de060ffcc4b to your computer and use it in GitHub Desktop.
Patch for xapian.InvalidArgumentError: Term too long (> 245):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def split_word(word, length=230): | |
| return (word[n:n+length] for n in range(0, len(word), length)) | |
| def prepare_YOUR_FIELD(self, obj): | |
| return u' '.join(item for word in obj.YOUR_FIELD.split() for item in split_word(word)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment