- query:<name>
+- property:<key>=<value>
+
The **from:** prefix is used to match the name or address of the sender
of an email message.
available if notmuch is built with **Xapian Field Processors** (see
below).
+The **property:** prefix searches for messages with a particular
+<key>=<value> property pair. Properties are used internally by notmuch
+(and extensions) to add metadata to messages. A given key can be
+present on a given message with several different values.
+
Operators
---------
Boolean
- **tag:**, **id:**, **thread:**, **folder:**, **path:**
+ **tag:**, **id:**, **thread:**, **folder:**, **path:**, **property:**
Probabilistic
**from:**, **to:**, **subject:**, **attachment:**, **mimetype:**
* STRING is the name of a file within that
* directory for this mail message.
*
+ * property: Has a property with key=value
+ * FIXME: if no = is present, should match on any value
+ *
* A mail document also has four values:
*
* TIMESTAMP: The time_t value corresponding to the message's
{ "directory", "XDIRECTORY" },
{ "file-direntry", "XFDIRENTRY" },
{ "directory-direntry", "XDDIRENTRY" },
- { "property", "XPROPERTY" },
};
static prefix_t BOOLEAN_PREFIX_EXTERNAL[] = {
{ "is", "K" },
{ "id", "Q" },
{ "path", "P" },
+ { "property", "XPROPERTY" },
/*
* Unconditionally add ':' to reduce potential ambiguity with
* overlapping prefixes and/or terms that start with capital
notmuch dump | grep '^#=' > OUTPUT
test_expect_equal_file PROPERTIES OUTPUT
+test_begin_subtest "test 'property:' queries: empty"
+notmuch search property:testkey1=charles > OUTPUT
+test_expect_equal_file /dev/null OUTPUT
+
+test_begin_subtest "test 'property:' queries: single message"
+notmuch search --output=messages property:testkey1=alice > OUTPUT
+cat <<EOF >EXPECTED
+id:4EFC743A.3060609@april.org
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
test_done