aboutsummaryrefslogtreecommitdiff
path: root/lib/database-private.h
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2019-03-18 21:39:21 -0300
committerDavid Bremner <david@tethera.net>2019-04-17 08:48:16 -0300
commit319dd95ebbd841320e269d34e67a824876f8426a (patch)
tree3f57795432d7a2d6573e77cab3e9176a507098d0 /lib/database-private.h
parent9fbc5cb578c60762ab9c2a24a14d4d07de516790 (diff)
lib: add 'body:' field, stop indexing headers twice.
The new `body:` field (in Xapian terms) or prefix (in slightly sloppier notmuch) terms allows matching terms that occur only in the body. Unprefixed query terms should continue to match anywhere (header or body) in the message. This follows a suggestion of Olly Betts to use the facility (since Xapian 1.0.4) to add the same field with multiple prefixes. The double indexing of previous versions is thus replaced with a query time expension of unprefixed query terms to the various prefixed equivalent. Reindexing will be needed for 'body:' searches to work correctly; otherwise they will also match messages where the term occur in headers (demonstrated by the new tests in T530-upgrade.sh)
Diffstat (limited to 'lib/database-private.h')
-rw-r--r--lib/database-private.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/database-private.h b/lib/database-private.h
index a499b259..293f2db4 100644
--- a/lib/database-private.h
+++ b/lib/database-private.h
@@ -108,6 +108,12 @@ enum _notmuch_features {
*
* Introduced: version 3. */
NOTMUCH_FEATURE_LAST_MOD = 1 << 6,
+
+ /* If set, unprefixed terms are stored only for the message body,
+ * not for headers.
+ *
+ * Introduced: version 3. */
+ NOTMUCH_FEATURE_UNPREFIX_BODY_ONLY = 1 << 7,
};
/* In C++, a named enum is its own type, so define bitwise operators