mirror of
https://github.com/Hopiu/xapian-haystack.git
synced 2026-03-16 22:20:31 +00:00
Catched AttributeError for old Xapian versions.
This commit is contained in:
parent
82ba90b6a6
commit
3e8611265e
1 changed files with 5 additions and 1 deletions
|
|
@ -276,7 +276,11 @@ class XapianSearchBackend(BaseSearchBackend):
|
|||
term_generator = xapian.TermGenerator()
|
||||
term_generator.set_database(database)
|
||||
term_generator.set_stemmer(xapian.Stem(self.language))
|
||||
term_generator.set_stemming_strategy(self.stemming_strategy)
|
||||
try:
|
||||
term_generator.set_stemming_strategy(self.stemming_strategy)
|
||||
except AttributeError:
|
||||
# Versions before Xapian 1.2.11 do not support stemming strategies for TermGenerator
|
||||
pass
|
||||
if self.include_spelling is True:
|
||||
term_generator.set_flags(xapian.TermGenerator.FLAG_SPELLING)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue