commit 45c381d1393a2228f185e50beb59de8400ab2d7c
parent 292f1f35d7b3d56ed03b3dc452ecde290301ac0e
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date: Thu, 14 Jan 2010 21:14:29 -0800
xapian: add boolean terms with zero wdf
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.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
@@ -597,7 +597,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