Subject: [sup-devel] [PATCH] xapian: add boolean terms with zero wdf

From: Rich Lane <[email-masked]>
Date: Thu, 14 Jan 2010 21:14:29 -0800

Xapian's Flint backend stores the document length in every posting, so if the
document length is changed (by adding a label, for example), every posting
entry needs to be rewritten. This basically nullifies the performance
improvement from the Xapian bug 250 fix. We can prevent this by adding these
terms with 0 within-document-frequency so that their addition or removal
doesn't change the document length.

This is the analog to notmuch commit ccf2e0cc.
---
 lib/sup/xapian_index.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
index c81dca4..99d7c0e 100644
--- a/lib/sup/xapian_index.rb
+++ b/lib/sup/xapian_index.rb
@@ -590,7 +590,7 @@ class Xapian::Document
   alias old_add_term add_term
   def add_term term
     if term.length <= Redwood::XapianIndex::MAX_TERM_LENGTH
-      old_add_term term
+      old_add_term term, 0
     else
       warn "dropping excessively long term #{term}"
     end
-- 
1.6.3.3

_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: William Morgan <[email-masked]>
Date: Sat, 23 Jan 2010 07:43:18 -0500

Applied to master and will go out in 0.10. Thanks!
-- 
William <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel