1 .TH NOTMUCH-SEARCH 1 2012-08-20 "Notmuch 0.14"
3 notmuch-search \- search for messages matching the given search terms
7 .RI [ options "...] <" search-term ">..."
11 Search for messages matching the given search terms, and display as
12 results the threads containing the matched messages.
14 The output consists of one line per thread, giving a thread ID, the
15 date of the newest (or oldest, depending on the sort option) matched
16 message in the thread, the number of matched messages and total
17 messages in the thread, the names of all participants in the thread,
18 and the subject of the newest (or oldest) message.
20 See \fBnotmuch-search-terms\fR(7)
21 for details of the supported syntax for <search-terms>.
28 .BR \-\-format= ( json | sexp | text )
30 Presents the results in either JSON, S-Expressions or plain-text (default).
35 .BR \-\-format-version=N
37 Use the specified structured output format version. This is intended
38 for programs that invoke \fBnotmuch\fR(1) internally. If omitted, the
39 latest supported version will be used.
44 .B \-\-output=(summary|threads|messages|files|tags)
50 Output a summary of each thread with any message matching the search
51 terms. The summary includes the thread ID, date, the number of
52 messages in the thread (both the number matched and the total number),
53 the authors of the thread and the subject.
59 Output the thread IDs of all threads with any message matching the
60 search terms, either one per line (\-\-format=text) or as a JSON array
61 (\-\-format=json) or an S-Expression list (\-\-format=sexp).
67 Output the message IDs of all messages matching the search terms,
68 either one per line (\-\-format=text) or as a JSON array
69 (\-\-format=json) or as an S-Expression list (\-\-format=sexp).
75 Output the filenames of all messages matching the search terms, either
76 one per line (\-\-format=text) or as a JSON array (\-\-format=json) or
77 as an S-Expression list (\-\-format=sexp).
83 Output all tags that appear on any message matching the search terms,
84 either one per line (\-\-format=text) or as a JSON array (\-\-format=json)
85 or as an S-Expression list (\-\-format=sexp).
91 .BR \-\-sort= ( newest\-first | oldest\-first )
93 This option can be used to present results in either chronological order
95 or reverse chronological order
96 .RB ( newest\-first ).
98 Note: The thread order will be distinct between these two options
99 (beyond being simply reversed). When sorting by
101 the threads will be sorted by the oldest message in each thread, but
104 the threads will be sorted by the newest message in each thread.
106 By default, results will be displayed in reverse chronological order,
107 (that is, the newest results will be displayed first).
114 Skip displaying the first N results. With the leading '\-', start at the Nth
122 Limit the number of displayed results to N.
127 .BR \-\-exclude=(true|false|flag)
129 Specify whether to omit messages matching search.tag_exclude from the
130 search results (the default) or not. The extra option
132 only has an effect when
134 In this case all matching threads are returned but the "match count"
135 is the number of matching non-excluded messages in the thread.
140 This command supports the following special exit status codes
144 The requested format version is too old.
147 The requested format version is too new.
151 \fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),
152 \fBnotmuch-dump\fR(1), \fBnotmuch-hooks\fR(5), \fBnotmuch-new\fR(1),
153 \fBnotmuch-reply\fR(1), \fBnotmuch-restore\fR(1),
154 \fBnotmuch-search-terms\fR(7), \fBnotmuch-show\fR(1),