1 .. _notmuch-sexp-queries(7):
10 **notmuch** **search** ``--query=sexp`` '(and (to santa) (date december))'
19 An *s-expression* is either an atom, or list of whitespace delimited
20 s-expressions inside parentheses. Atoms are either
23 A basic value is an unquoted string containing no whitespace, double quotes, or
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 \""``.
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
41 The empty list matches all messages
44 Match all messages containing *term*, possibly after
45 stemming or phase splitting. For discussion of stemming in
46 notmuch see :any:`notmuch-search-terms(7)`. Stemming only applies
47 to unquoted terms (basic values) in s-expression queries.
49 ``(`` *field* |q1| |q2| ... |qn| ``)``
50 Restrict the queries |q1| to |qn| to *field*, and combine with *and*
51 (for most fields) or *or*. See :any:`fields` for more information.
53 ``(`` *operator* |q1| |q2| ... |qn| ``)``
54 Combine queries |q1| to |qn|. Currently supported operators are
55 ``and``, ``or``, and ``not``. ``(not`` |q1| ... |qn| ``)`` is equivalent
56 to ``(and (not`` |q1| ``) ... (not`` |qn| ``))``.
58 ``(`` *modifier* |q1| |q2| ... |qn| ``)``
59 Combine queries |q1| to |qn|, and reinterpret the result (e.g. as a regular expression).
60 See :any:`modifiers` for more information.
76 Match all messages containing the word "wizard", ignoring case.
79 Match all messages containing "added", but also those containing "add", "additional",
80 "Additional", "adds", etc... via stemming.
83 Match messages containing words "Bob" and "Marley", or their stems
84 The words need not be adjacent.
87 Match messages containing neither "Bob" nor "Marley", nor their stems,
89 .. |q1| replace:: :math:`q_1`
90 .. |q2| replace:: :math:`q_2`
91 .. |qn| replace:: :math:`q_n`