unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 4/4] doc: document thread subqueries
Date: Sat,  5 May 2018 13:05:23 -0300	[thread overview]
Message-ID: <20180505160523.9749-5-david@tethera.net> (raw)
In-Reply-To: <20180505160523.9749-1-david@tethera.net>

Mention both performance and quoting issues.
---
 doc/man7/notmuch-search-terms.rst | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/doc/man7/notmuch-search-terms.rst b/doc/man7/notmuch-search-terms.rst
index 248444e3..ec999eed 100644
--- a/doc/man7/notmuch-search-terms.rst
+++ b/doc/man7/notmuch-search-terms.rst
@@ -83,6 +83,22 @@ thread:<thread-id>
     messages). These thread ID values can be seen in the first column
     of output from **notmuch search**
 
+thread:{<notmuch query>}
+    If notmuch is built with **Xapian Field Processors** (see below),
+    threads may be searched for indirectly by providing an arbitrary
+    notmuch query in **{}**. For example, the following returns
+    threads containing a message from mallory and one (not neccesarily
+    the same message) with Subject containing the word "crypto".
+
+    ::
+
+       % notmuch search 'thread:"{from:mallory}" and thread:"{subject:crypto}"'
+
+    The performance of such queries can vary wildly. To understand
+    this, the user should think of the query **thread:{<something>}**
+    as expanding to all of the thread IDs which match **<something>**;
+    notmuch then performs a second search using the expanded query.
+
 path:<directory-path> or path:<directory-path>/** or path:/<regex>/
     The **path:** prefix searches for email messages that are in
     particular directories within the mail store. The directory must
@@ -277,8 +293,8 @@ Quoting
 -------
 
 Double quotes are also used by the notmuch query parser to protect
-boolean terms or regular expressions containing spaces or other
-special characters, e.g.
+boolean terms, regular expressions, or subqueries containing spaces or
+other special characters, e.g.
 
 ::
 
@@ -288,12 +304,17 @@ special characters, e.g.
 
    folder:"/^.*/(Junk|Spam)$/"
 
+::
+
+   thread:"{from:mallory and date:2009}"
+
 As with phrases, you need to protect the double quotes from the shell
 e.g.
 
 ::
 
    % notmuch search 'folder:"/^.*/(Junk|Spam)$/"'
+   % notmuch search 'thread:"{from:mallory and date:2009}" and thread:{to:mallory}'
 
 DATE AND TIME SEARCH
 ====================
@@ -435,6 +456,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\\]/"
+- thread subqueries, e.g. "thread:{from:bob}"
 
 SEE ALSO
 ========
-- 
2.17.0

  parent reply	other threads:[~2018-05-05 16:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-05 16:05 Thread subqueries David Bremner
2018-05-05 16:05 ` [PATCH 1/4] lib: add thread subqueries David Bremner
2018-05-06 17:59   ` Jani Nikula
2018-05-05 16:05 ` [PATCH 2/4] perf-test: add simple test for " David Bremner
2018-05-05 16:05 ` [PATCH 3/4] lib: define specialized get_thread_id for use in thread subquery David Bremner
2018-05-06 18:03   ` Jani Nikula
2018-05-05 16:05 ` David Bremner [this message]
2018-05-06 18:05   ` [PATCH 4/4] doc: document thread subqueries Jani Nikula
2018-05-07 12:09 ` Thread subqueries David Bremner
2018-05-07 12:39   ` Gaute Hope
2018-05-11  8:43   ` Daniel Kahn Gillmor
2018-05-11 10:15     ` David Bremner
2018-05-11 15:41       ` Daniel Kahn Gillmor
2018-05-12 13:24         ` Tomi Ollila
2018-05-12 14:01           ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180505160523.9749-5-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).