From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id EBBDB6DE0A90 for ; Sun, 6 May 2018 11:05:25 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.036 X-Spam-Level: X-Spam-Status: No, score=0.036 tagged_above=-999 required=5 tests=[AWL=0.056, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cbtA9c0kzT7B for ; Sun, 6 May 2018 11:05:25 -0700 (PDT) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) by arlo.cworth.org (Postfix) with ESMTPS id C62A76DE0352 for ; Sun, 6 May 2018 11:05:24 -0700 (PDT) Received: by mail-lf0-f67.google.com with SMTP id r2-v6so1289654lff.4 for ; Sun, 06 May 2018 11:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=zXliAYNVGwzWYN+9rDxmYr3qlIRHBTXI+HAfurnbZ7w=; b=gN3J/U03z5ChYDQuBpY+3lrGuhaob9WdnSJtgjD0b2J/JS+hXebmE7UGJOoxgSvM3P uJ+XTnwNlCs5Ub1Paxj3XsEhlpcGWQRsqOjO/yKAMpt4tiludW4wEZlTjYF+Sljp74Wu s8xILoCvlV/DN6RQdKE9gmdFa8naCecvjPEFUcRLk9aI2qxTcqogemvvq0m/iRntI05b XCcBBXscRrO27EAutlgIldVwtGN5Bm4ixsgGLvjwYhuAQd22Qjh4irG76F5jRWjDdYPb lBRD5DMCLjkbk5ZhZjQzscj69fWFEvtxCbU+9paVipnpeSK0WGwd2kkFhB5yuZV3gxkA JOfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=zXliAYNVGwzWYN+9rDxmYr3qlIRHBTXI+HAfurnbZ7w=; b=BHel5PLJq+gOJLywemKTpQfVRrTezcZFFQO4uXL/EGwddzMcgpzssBpB3PxIf5IGmM RI6rmk0HSf88IGnAUWS1CXSKEFM3ofRt2quuRcZ98tDnMg6uOwCNCfO/QygVcnMhxUf5 UhTY9FyfsjPqiFbtCTC5EsLlmS5SvJR6KjUUEAdZCpwxyfANXpcMFAlzbMhFzZ/sjam4 OA/Baw/QjAeMwKdkjZDxTmrWGjknzORO9AjuB0lUOngtrjwZWChiRGL/56WfWO3QvFK2 wt+yAqP3/oQ6EHasCR8tlEi3nXgHD3LvAr0NoBNgfhwCwDatFTosoStRKkhuLb6o+Zlj NSaw== X-Gm-Message-State: ALKqPwc5BKZJjRaJGNhjLGQslgE+F88fN3EVbpI+iQWbQEhG6Qfdl27b 1yFITrwlsnnxzJZUPNE2aJb25JGfyfA= X-Google-Smtp-Source: AB8JxZpVfkzFOIF/5J7bbcvNrcqQiYjwt5TQnMvuZe+WPzrjH286JnJnELf/0Rw2/bJzXC8IW+rvBQ== X-Received: by 2002:a19:1444:: with SMTP id k65-v6mr1488550lfi.80.1525629923169; Sun, 06 May 2018 11:05:23 -0700 (PDT) Received: from localhost (82-181-191-221.bb.dnainternet.fi. [82.181.191.221]) by smtp.gmail.com with ESMTPSA id u83-v6sm4488878lff.65.2018.05.06.11.05.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 06 May 2018 11:05:22 -0700 (PDT) From: Jani Nikula To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH 4/4] doc: document thread subqueries In-Reply-To: <20180505160523.9749-5-david@tethera.net> References: <20180505160523.9749-1-david@tethera.net> <20180505160523.9749-5-david@tethera.net> Date: Sun, 06 May 2018 21:05:21 +0300 Message-ID: <877eogk6ce.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 May 2018 18:05:26 -0000 On Sat, 05 May 2018, David Bremner wrote: > 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: > messages). These thread ID values can be seen in the first column > of output from **notmuch search** > > +thread:{} > + 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 neccesarily typo. Otherwise LGTM. > + 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:{}** > + as expanding to all of the thread IDs which match ****; > + notmuch then performs a second search using the expanded query. > + > path: or path:/** or path:// > 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 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch