]> git.cworth.org Git - notmuch/blob - doc/man7/notmuch-sexp-queries.rst
lib/parse-sexp: parse single terms and the empty list.
[notmuch] / doc / man7 / notmuch-sexp-queries.rst
1 .. _notmuch-sexp-queries(7):
2
3 ====================
4 notmuch-sexp-queries
5 ====================
6
7 SYNOPSIS
8 ========
9
10 **notmuch** **search** ``--query=sexp`` '(and (to santa) (date december))'
11
12 DESCRIPTION
13 ===========
14
15
16 S-EXPRESSIONS
17 -------------
18
19 An *s-expression* is either an atom, or list of whitespace delimited
20 s-expressions inside parentheses. Atoms are either
21
22 *basic value*
23     A basic value is an unquoted string containing no whitespace, double quotes, or
24     parentheses.
25
26 *quoted string*
27     Double quotes (") delimit strings possibly containing whitespace
28     or parentheses. These can contain double quote characters by
29     escaping with backslash. E.g. ``"this is a quote \""``.
30
31 S-EXPRESSION QUERIES
32 --------------------
33
34 An s-expression query is either an atom, the empty list, or a
35 *compound query* consisting of a prefix atom (first element) defining
36 a *field*, *logical operation*, or *modifier*, and 0 or more
37 subqueries.
38
39 ``*``
40 ``()``
41     The empty list matches all messages
42
43 *term*
44     Match all messages containing *term*, possibly after stemming
45     or phase splitting.
46
47 ``(`` *field* |q1| |q2| ... |qn| ``)``
48     Restrict the queries |q1| to |qn| to *field*, and combine with *and*
49     (for most fields) or *or*. See :any:`fields` for more information.
50
51 ``(`` *operator* |q1| |q2| ... |qn| ``)``
52     Combine queries |q1| to |qn|. See :any:`operators` for more information.
53
54 ``(`` *modifier* |q1| |q2| ... |qn| ``)``
55     Combine queries |q1| to |qn|, and reinterpret the result (e.g. as a regular expression).
56     See :any:`modifiers` for more information.
57
58 .. _fields:
59
60 FIELDS
61 ``````
62
63 .. _operators:
64
65 OPERATORS
66 `````````
67
68 .. _modifiers:
69
70 MODIFIERS
71 `````````
72
73 EXAMPLES
74 ========
75
76 ``Wizard``
77     Match all messages containing the word "wizard", ignoring case.
78
79 .. |q1| replace:: :math:`q_1`
80 .. |q2| replace:: :math:`q_2`
81 .. |qn| replace:: :math:`q_n`