]> git.notmuchmail.org Git - notmuch/blob - man/man1/notmuch-search.1
Updating man pages for new S-Expression output format.
[notmuch] / man / man1 / notmuch-search.1
1 .TH NOTMUCH-SEARCH 1 2012-08-20 "Notmuch 0.14"
2 .SH NAME
3 notmuch-search \- search for messages matching the given search terms
4 .SH SYNOPSIS
5
6 .B notmuch search
7 .RI  [  options "...] <" search-term ">..."
8
9 .SH DESCRIPTION
10
11 Search for messages matching the given search terms, and display as
12 results the threads containing the matched messages.
13
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.
19
20 See \fBnotmuch-search-terms\fR(7)
21 for details of the supported syntax for <search-terms>.
22
23 Supported options for
24 .B search
25 include
26 .RS 4
27 .TP 4
28 .BR \-\-format= ( json | sexp | text )
29
30 Presents the results in either JSON, S-Expressions or plain-text (default).
31 .RE
32
33 .RS 4
34 .TP 4
35 .B \-\-output=(summary|threads|messages|files|tags)
36
37 .RS 4
38 .TP 4
39 .B summary
40
41 Output a summary of each thread with any message matching the search
42 terms. The summary includes the thread ID, date, the number of
43 messages in the thread (both the number matched and the total number),
44 the authors of the thread and the subject.
45 .RE
46 .RS 4
47 .TP 4
48 .B threads
49
50 Output the thread IDs of all threads with any message matching the
51 search terms, either one per line (\-\-format=text) or as a JSON array
52 (\-\-format=json) or an S-Expression list (\-\-format=sexp).
53 .RE
54 .RS 4
55 .TP 4
56 .B messages
57
58 Output the message IDs of all messages matching the search terms,
59 either one per line (\-\-format=text) or as a JSON array
60 (\-\-format=json) or as an S-Expression list (\-\-format=sexp).
61 .RE
62 .RS 4
63 .TP 4
64 .B files
65
66 Output the filenames of all messages matching the search terms, either
67 one per line (\-\-format=text) or as a JSON array (\-\-format=json) or
68 as an S-Expression list (\-\-format=sexp).
69 .RE
70 .RS 4
71 .TP 4
72 .B tags
73
74 Output all tags that appear on any message matching the search terms,
75 either one per line (\-\-format=text) or as a JSON array (\-\-format=json)
76 or as an S-Expression list (\-\-format=sexp).
77 .RE
78 .RE
79
80 .RS 4
81 .TP 4
82 .BR \-\-sort= ( newest\-first | oldest\-first )
83
84 This option can be used to present results in either chronological order
85 .RB ( oldest\-first )
86 or reverse chronological order
87 .RB ( newest\-first ).
88
89 Note: The thread order will be distinct between these two options
90 (beyond being simply reversed). When sorting by
91 .B oldest\-first
92 the threads will be sorted by the oldest message in each thread, but
93 when sorting by
94 .B newest\-first
95 the threads will be sorted by the newest message in each thread.
96
97 By default, results will be displayed in reverse chronological order,
98 (that is, the newest results will be displayed first).
99 .RE
100
101 .RS 4
102 .TP 4
103 .BR \-\-offset=[\-]N
104
105 Skip displaying the first N results. With the leading '\-', start at the Nth
106 result from the end.
107 .RE
108
109 .RS 4
110 .TP 4
111 .BR \-\-limit=N
112
113 Limit the number of displayed results to N.
114 .RE
115
116 .RS 4
117 .TP 4
118 .BR \-\-exclude=(true|false|flag)
119
120 Specify whether to omit messages matching search.tag_exclude from the
121 search results (the default) or not. The extra option
122 .B flag
123 only has an effect when
124 .B --output=summary
125 In this case all matching threads are returned but the "match count"
126 is the number of matching non-excluded messages in the thread.
127 .RE
128
129 .SH SEE ALSO
130
131 \fBnotmuch\fR(1), \fBnotmuch-config\fR(1), \fBnotmuch-count\fR(1),
132 \fBnotmuch-dump\fR(1), \fBnotmuch-hooks\fR(5), \fBnotmuch-new\fR(1),
133 \fBnotmuch-reply\fR(1), \fBnotmuch-restore\fR(1),
134 \fBnotmuch-search-terms\fR(7), \fBnotmuch-show\fR(1),
135 \fBnotmuch-tag\fR(1)