X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=manpages%2Fnotmuch-search-terms-7.mdwn;fp=manpages%2Fnotmuch-search-terms-7.mdwn;h=e6b87a36e581f87ef010622d04e01959d13eb8b3;hb=47c9a681445722a5b996786fb97df71747615bb7;hp=0259d42a486a33bb2c7cb16696e13b7aa3a4fdb0;hpb=05d265f8a3db616f17022105f8caea43d6225a8f;p=notmuch-wiki diff --git a/manpages/notmuch-search-terms-7.mdwn b/manpages/notmuch-search-terms-7.mdwn index 0259d42..e6b87a3 100644 --- a/manpages/notmuch-search-terms-7.mdwn +++ b/manpages/notmuch-search-terms-7.mdwn @@ -45,7 +45,7 @@ results to those whose value matches a regular expression (see regex(7)) delimited with //, for example: - notmuch search 'from:/bob@.*[.]example[.]com/' + notmuch search 'from:"/bob@.*[.]example[.]com/"' from:<name-or-address> or from:/<regex>/ The from: prefix is used to match the name or address of the @@ -86,50 +86,65 @@ messages). These thread ID values can be seen in the first col‐ umn 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 necessarily 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>; not‐ + much 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 partic‐ - ular directories within the mail store. The directory must be - specified relative to the top-level maildir (and without the + ular directories within the mail store. The directory must be + specified relative to the top-level maildir (and without the leading slash). By default, path: matches messages in the speci‐ - fied directory only. The "/**" suffix can be used to match mes‐ - sages in the specified directory and all its subdirectories - recursively. path:"" matches messages in the root of the mail + fied directory only. The "/**" suffix can be used to match mes‐ + sages in the specified directory and all its subdirectories + recursively. path:"" matches messages in the root of the mail store and, likewise, path:** matches all messages. - path: will find a message if any copy of that message is in the + path: will find a message if any copy of that message is in the specific directory. folder:<maildir-folder> or folder:/<regex>/ - The folder: prefix searches for email messages by maildir or MH - folder. For MH-style folders, this is equivalent to path:. For + The folder: prefix searches for email messages by maildir or MH + folder. For MH-style folders, this is equivalent to path:. For maildir, this includes messages in the "new" and "cur" subdirec‐ - tories. The exact syntax for maildir folders depends on your - mail configuration. For maildir++, folder:"" matches the inbox - folder (which is the root in maildir++), other folder names + tories. The exact syntax for maildir folders depends on your + mail configuration. For maildir++, folder:"" matches the inbox + folder (which is the root in maildir++), other folder names always start with ".", and nested folders are separated by "."s, such as folder:.classes.topology. For "file system" maildir, the inbox is typically folder:INBOX and nested folders are separated by slashes, such as folder:classes/topology. - folder: will find a message if any copy of that message is in + folder: will find a message if any copy of that message is in the specific folder. date:<since>..<until> or date:<date> - The date: prefix can be used to restrict the results to only - messages within a particular time range (based on the Date: + The date: prefix can be used to restrict the results to only + messages within a particular time range (based on the Date: header). - See DATE AND TIME SEARCH below for details on the range expres‐ + See DATE AND TIME SEARCH below for details on the range expres‐ sion, and supported syntax for <since> and <until> date and time expressions. - The time range can also be specified using timestamps with a - syntax of: + The time range can also be specified using timestamps without + including the date prefix using a syntax of: <initial-timestamp>..<final-timestamp> - Each timestamp is a number representing the number of seconds - since 1970-01-01 00:00:00 UTC. + Each timestamp is a number representing the number of seconds + since 1970-01-01 00:00:00 UTC. Specifying a time range this way + is considered legacy and predates the date prefix. lastmod:<initial-revision>..<final-revision> The lastmod: prefix can be used to restrict the result by the @@ -260,13 +275,32 @@ will not. +

  Quoting

+
+       Double  quotes  are  also  used  by the notmuch query parser to protect
+       boolean terms, regular expressions, or subqueries containing spaces  or
+       other special characters, e.g.
+
+          tag:"a tag"
+
+          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

-       notmuch  understands a variety of standard and natural ways of express‐
+       notmuch understands a variety of standard and natural ways of  express‐
        ing dates and times, both in absolute terms ("2012-10-24") and in rela‐
-       tive  terms ("yesterday"). Any number of relative terms can be combined
-       ("1 hour 25 minutes") and an absolute date/time can  be  combined  with
-       relative  terms  to  further adjust it. A non-exhaustive description of
+       tive terms ("yesterday"). Any number of relative terms can be  combined
+       ("1  hour  25  minutes") and an absolute date/time can be combined with
+       relative terms to further adjust it. A  non-exhaustive  description  of
        the syntax supported for absolute and relative terms is given below.
 
@@ -274,15 +308,21 @@
        date:<since>..<until>
 
-       The above expression  restricts  the  results  to  only  messages  from
+       The  above  expression  restricts  the  results  to  only messages from
        <since> to <until>, based on the Date: header.
 
-       <since>  and <until> can describe imprecise times, such as "yesterday".
-       In this case, <since> is taken as the earliest time it  could  describe
+       <since> and <until> can describe imprecise times, such as  "yesterday".
+       In  this  case, <since> is taken as the earliest time it could describe
        (the beginning of yesterday) and <until> is taken as the latest time it
-       could describe (the end of yesterday). Similarly,  date:january..febru‐
+       could  describe (the end of yesterday). Similarly, date:january..febru‐
        ary matches from the beginning of January to the end of February.
 
+       If specifying a time range using timestamps  in  conjunction  with  the
+       date  prefix,  each  timestamp must be preceded by @ (ASCII hex 40). As
+       above, each timestamp is a number representing the  number  of  seconds
+       since 1970-01-01 00:00:00 UTC. For example:
+          date:@<initial-timestamp>..@<final-timestamp>
+
        date:<expr>..!  can be used as a shorthand for date:<expr>..<expr>. The
        expansion takes place before interpretation,  and  thus,  for  example,
        date:monday..!  matches  from  the beginning of Monday until the end of
@@ -391,6 +431,8 @@
        · named queries e.g. "query:my_special_query"
 
        · regular expression searches, e.g. "subject:/^\[SPAM\]/"
+
+       · thread subqueries, e.g. "thread:{from:bob}"
 

SEE ALSO

@@ -411,4 +453,4 @@ 2009-2018, Carl Worth and many others -

0.26

+

0.27