]> git.notmuchmail.org Git - notmuch/commit
lib: add 'body:' field, stop indexing headers twice.
authorDavid Bremner <david@tethera.net>
Tue, 19 Mar 2019 00:39:21 +0000 (21:39 -0300)
committerDavid Bremner <david@tethera.net>
Wed, 17 Apr 2019 11:48:16 +0000 (08:48 -0300)
commit319dd95ebbd841320e269d34e67a824876f8426a
tree3f57795432d7a2d6573e77cab3e9176a507098d0
parent9fbc5cb578c60762ab9c2a24a14d4d07de516790
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)
doc/man7/notmuch-search-terms.rst
lib/database-private.h
lib/database.cc
lib/message.cc
test/T530-upgrade.sh
test/T740-body.sh [new file with mode: 0755]