+
+ In addition to the standard boolean operators, Xapian provides several
+ operators specific to text searching.
+
+ notmuch search term1 NEAR term2
+
+ will return results where term1 is within 10 words of term2. The
+ threshold can be set like this:
+
+ notmuch search term1 NEAR/2 term2
+
+ The search
+
+ notmuch search term1 ADJ term2
+
+ will return results where term1 is within 10 words of term2, but in the
+ same order as in the query. The threshold can be set the same as with
+ NEAR:
+
+ notmuch search term1 ADJ/7 term2
+</pre>
+
+<h3> Stemming</h3>
+<pre>
+ <b>Stemming</b> in notmuch means that these searches
+
+ notmuch search detailed
+ notmuch search details
+ notmuch search detail
+
+ will all return identical results, because Xapian first "reduces" the
+ term to the common stem (here 'detail') and then performs the search.
+
+ There are two ways to turn this off: a search for a capitalized word
+ will be performed unstemmed, so that one can search for "John" and not
+ get results for "Johnson"; phrase searches are also unstemmed (see
+ below for details). Stemming is currently only supported for English.
+ Searches for words in other languages will be performed unstemmed.
+</pre>
+
+<h3> Wildcards</h3>
+<pre>
+ It is possible to use a trailing '*' as a wildcard. A search for
+ 'wildc*' will match 'wildcard', 'wildcat', etc.
+</pre>
+
+<h3> Boolean and Probabilistic Prefixes</h3>
+<pre>
+ Xapian (and hence notmuch) prefixes are either <b>boolean</b>, supporting
+ exact matches like "<u>tag:inbox</u>" or <b>probabilistic</b>, supporting a more
+ flexible <b>term</b> based searching. The prefixes currently supported by not‐
+ much are as follows.
+
+ <b>Boolean</b>
+ <b>tag:</b>, <b>id:</b>, <b>thread:</b>, <b>folder:</b>, <b>path:</b>, <b>property:</b>
+
+ <b>Probabilistic</b>
+ <b>from:</b>, <b>to:</b>, <b>subject:</b>, <b>attachment:</b>, <b>mimetype:</b>
+</pre>
+
+<h3> Terms and phrases</h3>
+<pre>
+ In general Xapian distinguishes between lists of terms and <b>phrases</b>.
+ Phrases are indicated by double quotes (but beware you probably need to
+ protect those from your shell) and insist that those unstemmed words
+ occur in that order. One useful, but initially surprising feature is
+ that the following are equivalant ways to write the same phrase.
+
+ · "a list of words"
+
+ · a-list-of-words
+
+ · a/list/of/words
+
+ · a.list.of.words
+
+ Both parenthesised lists of terms and quoted phrases are ok with proba‐
+ bilisitic prefixes such as <b>to:</b>, <b>from:</b>, and <b>subject:</b>. In particular
+
+ subject:(pizza free)
+
+ is equivalent to
+
+ subject:pizza and subject:free
+
+ Both of these will match a subject "Free Delicious Pizza" while
+
+ subject:"pizza free"
+
+ will not.