aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2017-02-26 22:34:20 -0400
committerDavid Bremner <david@tethera.net>2017-03-03 17:46:48 -0400
commit55524bb063c95ae51a1762eb0b1aacce6ca49223 (patch)
tree06ec5e27a5d20ca917bbff7e9d732ab94cff0fc2 /doc
parent31b8ce4558de69860c95bf319a0a162316dce6c6 (diff)
lib: regexp matching in 'subject' and 'from'
the idea is that you can run % notmuch search subject:/<your-favourite-regexp>/ % notmuch search from:/<your-favourite-regexp>/ or % notmuch search subject:"your usual phrase search" % notmuch search from:"usual phrase search" This feature is only available with recent Xapian, specifically support for field processors is needed. It should work with bindings, since it extends the query parser. This is easy to extend for other value slots, but currently the only value slots are date, message_id, from, subject, and last_mod. Date is already searchable; message_id is left for a followup commit. This was originally written by Austin Clements, and ported to Xapian field processors (from Austin's custom query parser) by yours truly.
Diffstat (limited to 'doc')
-rw-r--r--doc/man7/notmuch-search-terms.rst25
1 files changed, 22 insertions, 3 deletions
diff --git a/doc/man7/notmuch-search-terms.rst b/doc/man7/notmuch-search-terms.rst
index de93d733..47cab48d 100644
--- a/doc/man7/notmuch-search-terms.rst
+++ b/doc/man7/notmuch-search-terms.rst
@@ -34,10 +34,14 @@ indicate user-supplied values):
- from:<name-or-address>
+- from:/<regex>/
+
- to:<name-or-address>
- subject:<word-or-quoted-phrase>
+- subject:/<regex>/
+
- attachment:<word>
- mimetype:<word>
@@ -71,6 +75,15 @@ subject of an email. Searching for a phrase in the subject is supported
by including quotation marks around the phrase, immediately following
**subject:**.
+If notmuch is built with **Xapian Field Processors** (see below) the
+**from:** and **subject** prefix can be also used to restrict the
+results to those whose from/subject value matches a regular expression
+(see **regex(7)**) delimited with //.
+
+::
+
+ notmuch search 'from:/bob@.*[.]example[.]com/'
+
The **attachment:** prefix can be used to search for specific filenames
(or extensions) of attachments to email messages.
@@ -220,13 +233,18 @@ Boolean and Probabilistic Prefixes
----------------------------------
Xapian (and hence notmuch) prefixes are either **boolean**, supporting
-exact matches like "tag:inbox" or **probabilistic**, supporting a more flexible **term** based searching. The prefixes currently supported by notmuch are as follows.
-
+exact matches like "tag:inbox" or **probabilistic**, supporting a more
+flexible **term** based searching. Certain **special** prefixes are
+processed by notmuch in a way not stricly fitting either of Xapian's
+built in styles. The prefixes currently supported by notmuch are as
+follows.
Boolean
**tag:**, **id:**, **thread:**, **folder:**, **path:**, **property:**
Probabilistic
- **from:**, **to:**, **subject:**, **attachment:**, **mimetype:**
+ **to:**, **attachment:**, **mimetype:**
+Special
+ **from:**, **query:**, **subject:**
Terms and phrases
-----------------
@@ -396,6 +414,7 @@ Currently the following features require field processor support:
- non-range date queries, e.g. "date:today"
- named queries e.g. "query:my_special_query"
+- regular expression searches, e.g. "subject:/^\\[SPAM\\]/"
SEE ALSO
========