aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/directory.cc
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-01-09 11:18:27 -0800
committerGravatar Carl Worth <cworth@cworth.org>2010-01-09 11:18:27 -0800
commitccf2e0cc4211c276da1db43cdca7ee11018c391d (patch)
tree7b20fa1eb63cd822c5464fc9c44224e7e810c1ae /lib/directory.cc
parent45b1856782beca246cd2670ea6b122b0c9e06fc0 (diff)
lib: Add non-content terms with a WDF value of 0.
The WDF is the "within-document frequency" value for a particular term. It's intended to provide an indication of how frequent a term is within a document, (for use in computing relevance). Xapian's term generator already computes WDF values when we use that, (which we do for indexing all mail content). We don't use the term generator when adding single terms for things that don't actually appear in the mail document, (such as tags, the filename, etc.). In this case, the WDF value for these terms doesn't matter much. But Xapian's flint backend can be more efficient with changes to terms that don't affect the document "length". So there's a performance advantage for manipulating tags (with the flint backend) if the WDF of these terms is 0.
Diffstat (limited to 'lib/directory.cc')
-rw-r--r--lib/directory.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/directory.cc b/lib/directory.cc
index 461c0cc3..bb6314ad 100644
--- a/lib/directory.cc
+++ b/lib/directory.cc
@@ -213,7 +213,7 @@ _notmuch_directory_create (notmuch_database_t *notmuch,
Xapian::docid parent_id;
char *term = talloc_asprintf (local, "%s%s",
_find_prefix ("directory"), db_path);
- directory->doc.add_term (term);
+ directory->doc.add_term (term, 0);
directory->doc.set_data (path);
@@ -225,7 +225,7 @@ _notmuch_directory_create (notmuch_database_t *notmuch,
term = talloc_asprintf (local, "%s%u:%s",
_find_prefix ("directory-direntry"),
parent_id, basename);
- directory->doc.add_term (term);
+ directory->doc.add_term (term, 0);
}
directory->doc.add_value (NOTMUCH_VALUE_TIMESTAMP,