commit 018591496912c641eb89abad4f6cff855d49d9eb
parent 375f91a24236057eab531bada2cfb2d70cac542a
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Wed, 5 Aug 2009 15:55:42 -0400
Merge branch 'master' into next
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
@@ -304,6 +304,8 @@ class XapianIndex < BaseIndex
DATE_VALUENO = 0
+ MAX_TERM_LENGTH = 245
+
# Xapian can very efficiently sort in ascending docid order. Sup always wants
# to sort by descending date, so this method maps between them. In order to
# handle multiple messages per second, we use a logistic curve centered
@@ -428,7 +430,7 @@ class XapianIndex < BaseIndex
@term_generator.document = doc
text.each { |text,prefix| @term_generator.index_text text, 1, prefix }
- terms.each { |term| doc.add_term term }
+ terms.each { |term| doc.add_term term if term.length <= MAX_TERM_LENGTH }
doc.add_value DATE_VALUENO, date_value
doc.data = m.id