aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-08-26 09:47:38 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-08-29 09:44:32 +0100
commitd5384ba1b739c7ca3a8fcab4cdda35965d33c6ee (patch)
tree43c70ff14aeae23c41dcf169f3e80eaadfee6564
parent45fc8c3e18dc5e43e98fc1fae5b519f1440086ea (diff)
Only index multiple locales in single index for text indices
-rw-r--r--vendor/plugins/acts_as_xapian/lib/acts_as_xapian.rb6
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