1LEI-Q(1)                   public-inbox user manual                   LEI-Q(1)
2
3
4

NAME

6       lei-q - search for messages matching terms
7

SYNOPSIS

9       lei q [OPTIONS] TERM [TERM...]
10
11       lei q [OPTIONS] (--stdin|-)
12

DESCRIPTION

14       Search for messages across the lei/store and externals.
15

OPTIONS

17       --stdin
18           Read search terms from stdin.
19
20       --no-save
21           Do not save the search for lei-up(1).
22
23       --output=MFOLDER
24       -o MFOLDER
25       --mfolder=MFOLDER
26           Warning: this clobbers and overwrites the output destination unless
27           "--augment" is specified.
28
29           Destination for results (e.g., "/tmp/results-Maildir",
30           "imaps://user@mail.example.com/INBOX.test", or
31           "mboxcl2:/tmp/results-mboxcl2").  The prefix may be a supported
32           protocol: "imap://" or "imaps://".  URLs requiring authentication
33           use git-credential(1) to fill in the username and password.
34
35           A prefix can specify the format of the output: "maildir", "mboxrd",
36           "mboxcl2", "mboxcl", "mboxo".  For a description of mail formats,
37           see lei-mail-formats(5).
38
39           "v2:/path/to/inbox" may be used to create a new inbox of
40           public-inbox-v2-format(5).  The new inbox will not be configured in
41           the public-inbox-config(5) file.
42
43           "maildir" is the default for an existing directory or non-existing
44           path.
45
46           Default: "-" (stdout)
47
48       --format=FORMAT
49       -f FORMAT
50           Format of results to stdout.  This option exists as a convenient
51           way to specify the format for the default stdout destination.
52           "reply", "text", "json", "jsonl", or "concatjson" are all
53           supported, as are the various mbox variants described in
54           "--output".
55
56           When a format isn't specified, it's chosen based on the "--output"
57           destination or prefix.  "json" is used for the default destination
58           (stdout).
59
60           Using a "format:" prefix with the "--output" destination is
61           preferred when not writing to stdout.
62
63       --no-color
64           Disable color (for "-f reply" and "-f text").
65
66       --pretty
67           Pretty print "json" or "concatjson" output.  If stdout is opened to
68           a tty and used as the "--output" destination, "--pretty" is enabled
69           by default.
70
71       --mua=COMMAND
72           A command to run on "--output" Maildir or mbox (e.g., "mutt -f
73           %f").  For a subset of MUAs known to accept a mailbox via "-f",
74           COMMAND can be abbreviated to the name of the program: "mutt",
75           "mailx", "mail", or "neomutt".
76
77       --alert=COMMAND[,COMMAND...]
78           Run "COMMAND" after writing to output.  ":WINCH" indicates to send
79           "SIGWINCH" to the "--mua" process.  ":bell" indicates to print a
80           bell code.  Any other value is interpreted as a command to execute
81           as is.
82
83           This option may be given multiple times.
84
85           Default: ":WINCH,:bell" when "--mua" is specified and "--output"
86           doesn't point to stdout, nothing otherwise.
87
88       --augment
89       -a  Augment output destination instead of clobbering it.
90
91       --no-import-before
92           Do not import keywords before writing to an existing output
93           destination.
94
95       --threads
96       -t  Return all messages in the same thread as the actual match(es).
97
98           Using this twice ("-tt") sets the "flagged" (AKA "important") on
99           messages which were actual matches.  This is useful to distinguish
100           messages which were direct hits from messages which were merely
101           part of the same thread.
102
103           TODO: Warning: this flag may become persistent and saved in
104           lei/store unless an MUA unflags it!  (Behavior undecided)
105
106           Caveat: "-tt" only works on locally-indexed messages at the moment,
107           and not on remote (HTTP(S)) endpoints.
108
109       --jobs=QUERY_WORKERS[,WRITE_WORKERS] =item --jobs=,WRITE_WORKERS
110       -j QUERY_WORKERS[,WRITE_WORKERS] =item -j ,WRITE_WORKERS
111           Set the number of query and write worker processes for parallelism.
112
113           "QUERY_WORKERS" defaults to the number of CPUs available, but 4 per
114           remote (HTTP/HTTPS) host.
115
116           "WRITE_WORKERS" defaults to 75% of the number of CPUs available for
117           Maildir and mbox* destinations, but 4 per IMAP/IMAPS host.
118
119           Omitting "QUERY_WORKERS" but leaving the comma (",") allows one to
120           only set "WRITE_WORKERS"
121
122       --dedupe=STRATEGY
123       -d STRATEGY
124           Strategy for deduplicating messages: "content", "oid", "mid", or
125           "none".
126
127           Default: "content"
128
129       --[no-]remote
130           Whether to include results requiring network access.  When local
131           externals are configured, "--remote" must be explicitly passed to
132           enable reporting of results from remote externals.
133
134       --no-local
135           Limit operations to those requiring network access.
136
137       --no-external
138           Don't include results from externals.
139
140       --include=LOCATION
141       -I LOCATION
142           Include specified external in search.  This option may be given
143           multiple times.
144
145       --exclude=LOCATION
146           Exclude specified external from search.  This option may be given
147           multiple times.
148
149       --only=LOCATION
150       -O LOCATION
151           Use only the specified external for search.  This option may be
152           given multiple times, in which case the search uses only the
153           specified set.
154
155       --globoff
156       -g  Do not match locations using "*?" wildcards and "[]" ranges.  This
157           option applies to "--include", "--exclude", and "--only".
158
159       --no-import-remote
160           Disable the default behavior of memoizing remote messages into the
161           local store.
162
163       --lock=METHOD
164           mbox(5) locking method(s) to use: "dotlock", "fcntl", "flock" or
165           "none".
166
167           Default: fcntl,dotlock
168
169       --limit=NUMBER
170       -NUMBER
171       -n NUMBER
172           Fuzzy limit the number of matches per-local external and lei/store.
173           Messages added by the --threads switch do not count towards this
174           limit, and there is no limit on remote externals.
175
176           Default: 10000
177
178       --offset=NUMBER
179           Shift start of search results.
180
181           Default: 0
182
183       --reverse
184       -r  Reverse the results.  Note that this applies before "--limit".
185
186       --sort=KEY
187       -s KEY
188           Order the results by KEY.  Valid keys are "received", "relevance",
189           and "docid".
190
191           Default: "received"
192
193       --verbose
194       -v  Provide more feedback on stderr.
195
196       --quiet
197       -q  Suppress feedback messages.
198
199       --torsocks=auto|no|yes
200       --no-torsocks
201           Whether to wrap git(1) and curl(1) commands with torsocks(1).
202
203           Default: "auto"
204
205       --proxy=PROTOCOL://HOST[:PORT]
206

SEARCH TERMS

208       "lei q" supports the same search prefixes used by HTTP(S) public-inbox
209       instances:
210
211         s:        match within Subject  e.g. s:"a quick brown fox"
212         d:        match date-time range, git "approxidate" formats supported
213                   Open-ended ranges such as `d:last.week..' and
214                   `d:..2.days.ago' are supported
215         b:        match within message body, including text attachments
216         nq:       match non-quoted text within message body
217         q:        match quoted text within message body
218         n:        match filename of attachment(s)
219         t:        match within the To header
220         c:        match within the Cc header
221         f:        match within the From header
222         a:        match within the To, Cc, and From headers
223         tc:       match within the To and Cc headers
224         l:        match contents of the List-Id header
225         bs:       match within the Subject and body
226         dfn:      match filename from diff
227         dfa:      match diff removed (-) lines
228         dfb:      match diff added (+) lines
229         dfhh:     match diff hunk header context (usually a function name)
230         dfctx:    match diff context lines
231         dfpre:    match pre-image git blob ID
232         dfpost:   match post-image git blob ID
233         dfblob:   match either pre or post-image git blob ID
234         patchid:  match `git patch-id --stable' output
235         rt:       match received time, like `d:' if sender's clock was correct
236
237       Additional search prefixes which only affect the local lei/store:
238
239         L:       match the given label
240         kw:      match the given keywords
241
242       See lei-tag(1) for more info on labels and keywords.
243
244       Most prefixes are probabilistic, meaning they support stemming and
245       wildcards ("*").  Ranges (such as "d:") and boolean prefixes do not
246       support stemming or wildcards.  The upstream Xapian query parser
247       documentation fully explains the query syntax:
248       <https://xapian.org/docs/queryparser.html>
249

TIPS

251       "-f reply" is intended to aid in turning a cover letter into a reply
252       (since using "git format-patch --in-reply-to=..."  is tedious).
253       Results (including "From " lines) should be edited and trimmed in your
254       favorite $EDITOR before sending.
255

CONTACT

257       Feedback welcome via plain-text mail to <mailto:meta@public-inbox.org>
258
259       The mail archives are hosted at <https://public-inbox.org/meta/> and
260       <http://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/meta/>
261
263       Copyright all contributors <mailto:meta@public-inbox.org>
264
265       License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
266

SEE ALSO

268       lei-add-external(1), lei-lcat(1), lei-up(1), Xapian::QueryParser Syntax
269       <https://xapian.org/docs/queryparser.html>
270
271
272
273public-inbox.git                  1993-10-02                          LEI-Q(1)
Impressum