diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-08-26 09:47:38 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-08-26 09:47:38 +0100 |
commit | f8745d1e5950d458eb2eca87f15b4f3b65ed42ae (patch) | |
tree | d25513abce55bded270d70c23ab1972da841238a | |
parent | 8aa8a88d938173dd3aa382d33c48d7e6063f1844 (diff) |
Only index multiple locales in single index for text indices
-rw-r--r-- | vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb | 6 |
1 files changed, 3 insertions, 3 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 43f0764ca..4671b79da 100644 --- a/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb +++ b/vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb @@ -668,8 +668,8 @@ module ActsAsXapian self.class.to_s + "-" + self.id.to_s end - def xapian_value(field, type = nil) - if self.respond_to?("translations") + def xapian_value(field, type = nil, index_translations = false) + if index_translations && self.respond_to?("translations") if type == :date or type == :boolean value = single_xapian_value(field, type = type) else @@ -756,7 +756,7 @@ module ActsAsXapian for text in self.xapian_options[:texts] ActsAsXapian.term_generator.increase_termpos # stop phrases spanning different text fields # XXX the "1" here is a weight that could be varied for a boost function - ActsAsXapian.term_generator.index_text(xapian_value(text), 1) + ActsAsXapian.term_generator.index_text(xapian_value(text, nil, true), 1) end end |