Skip to content

Commit

Permalink
Catched AttributeError for old Xapian versions.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrast authored and jorgecarleitao committed Jan 12, 2015
1 parent 82ba90b commit 3e86112
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xapian_backend.py
Expand Up @@ -276,7 +276,11 @@ def update(self, index, iterable):
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)

Expand Down

0 comments on commit 3e86112

Please sign in to comment.