aboutsummaryrefslogtreecommitdiff
path: root/lib/database.cc
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2016-07-08 11:15:36 +0200
committerDavid Bremner <david@tethera.net>2016-09-21 18:14:25 -0300
commit693ca8d8a80438ce1e361e7e6d22288f52a11c55 (patch)
tree447bce9c213a5662f86af02c91cfd3f827dad4f8 /lib/database.cc
parent651da30c0941081cf730930fc1a7cac34954ca0e (diff)
add property: query prefix to search for specific properties
We want to be able to query the properties directly, like: notmuch count property:foo=bar which should return a count of messages where the property with key "foo" has value equal to "bar".
Diffstat (limited to 'lib/database.cc')
-rw-r--r--lib/database.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/database.cc b/lib/database.cc
index 33e22d86..392e8b28 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -97,6 +97,9 @@ typedef struct {
* 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
@@ -251,7 +254,6 @@ static prefix_t BOOLEAN_PREFIX_INTERNAL[] = {
{ "directory", "XDIRECTORY" },
{ "file-direntry", "XFDIRENTRY" },
{ "directory-direntry", "XDDIRENTRY" },
- { "property", "XPROPERTY" },
};
static prefix_t BOOLEAN_PREFIX_EXTERNAL[] = {
@@ -260,6 +262,7 @@ 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