diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-01-19 14:39:24 +0000 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-01-19 14:39:24 +0000 |
commit | d3d5b804bb510cd851abdb4f40ddde5c327c38e9 (patch) | |
tree | 8c26aa552f78a8306eb31b8894601892027145b5 | |
parent | b2618cc78e86176c13e2b4197d56270242680884 (diff) |
Do not require Xapian 1.2.7
Work (with subtly reduced resilience) on earlier versions.
-rw-r--r-- | vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb index 656b722f6..ebb3b1cbd 100644 --- a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb +++ b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb @@ -143,7 +143,16 @@ module ActsAsXapian @@query_parser.stemming_strategy = Xapian::QueryParser::STEM_SOME @@query_parser.database = @@db @@query_parser.default_op = Xapian::Query::OP_AND - @@query_parser.set_max_wildcard_expansion(1000) + begin + @@query_parser.set_max_wildcard_expansion(1000) + rescue NoMethodError + # The set_max_wildcard_expansion method was introduced in Xapian 1.2.7, + # so may legitimately not be available. + # + # Large installations of Alaveteli should consider + # upgrading, because uncontrolled wildcard expansion + # can crash the whole server: see http://trac.xapian.org/ticket/350 + end @@stopper = Xapian::SimpleStopper.new @@stopper.add("and") |