mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
doc: add details about Xapian search syntax
Questions related to the way that probabilistic prefixes and phrases are handled come up quite often and it is nicer to have the documentation self contained. Hopefully putting it in subsections prevents it from being overwhelming.
This commit is contained in:
parent
b9e7b8e8f0
commit
4d5477a3d5
1 changed files with 52 additions and 0 deletions
|
@ -135,6 +135,58 @@ operators, but will have to be protected from interpretation by the
|
||||||
shell, (such as by putting quotation marks around any parenthesized
|
shell, (such as by putting quotation marks around any parenthesized
|
||||||
expression).
|
expression).
|
||||||
|
|
||||||
|
Boolean and Probabilistic Prefixes
|
||||||
|
----------------------------------
|
||||||
|
|
||||||
|
Xapian (and hence notmuch) prefixes are either **boolean**, supporting
|
||||||
|
exact matches like "tag:inbox" or **probabilistic**, supporting a most flexible **term** based searching. The prefixes currently supported by notmuch are as follows.
|
||||||
|
|
||||||
|
+------------------+-----------------------+
|
||||||
|
|Boolean |Probabilistic |
|
||||||
|
+------------------+-----------------------+
|
||||||
|
| **tag:** **id:** | **from:** **to:** |
|
||||||
|
|**thread:** |**subject:** |
|
||||||
|
|**folder:** |**attachment** |
|
||||||
|
|**path:** | |
|
||||||
|
| | |
|
||||||
|
+------------------+-----------------------+
|
||||||
|
|
||||||
|
Terms and phrases
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
In general Xapian distinguishes between lists of terms and
|
||||||
|
**phrases**. 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
|
||||||
|
probabilisitic prefixes such as **to:**, **from:**, and **subject:**. 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.
|
||||||
|
|
||||||
DATE AND TIME SEARCH
|
DATE AND TIME SEARCH
|
||||||
====================
|
====================
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue