]> git.notmuchmail.org Git - notmuch/blobdiff - lib/database.cc
lib: Add regexp searching for mid: prefix
[notmuch] / lib / database.cc
index a679cbabbac95a2d39885292341370e1d040d8c0..49b3849c32586124db4364c4c6815a25316f2bc7 100644 (file)
@@ -262,7 +262,8 @@ prefix_t prefix_table[] = {
     { "tag",                   "K",            NOTMUCH_FIELD_EXTERNAL },
     { "is",                    "K",            NOTMUCH_FIELD_EXTERNAL },
     { "id",                    "Q",            NOTMUCH_FIELD_EXTERNAL },
-    { "mid",                   "Q",            NOTMUCH_FIELD_EXTERNAL },
+    { "mid",                   "Q",            NOTMUCH_FIELD_EXTERNAL |
+                                               NOTMUCH_FIELD_PROCESSOR },
     { "path",                  "P",            NOTMUCH_FIELD_EXTERNAL },
     { "property",              "XPROPERTY",    NOTMUCH_FIELD_EXTERNAL },
     /*
@@ -313,7 +314,8 @@ _setup_query_field (const prefix_t *prefix, notmuch_database_t *notmuch)
        else if (STRNCMP_LITERAL(prefix->name, "query") == 0)
            fp = (new QueryFieldProcessor (*notmuch->query_parser, notmuch))->release ();
        else
-           fp = (new RegexpFieldProcessor (prefix->name, *notmuch->query_parser, notmuch))->release ();
+           fp = (new RegexpFieldProcessor (prefix->name, prefix->flags,
+                                           *notmuch->query_parser, notmuch))->release ();
 
        /* we treat all field-processor fields as boolean in order to get the raw input */
        notmuch->query_parser->add_boolean_prefix (prefix->name, fp);
@@ -1493,7 +1495,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
        query = notmuch_query_create (notmuch, "");
        unsigned msg_count;
 
-       status = notmuch_query_count_messages_st (query, &msg_count);
+       status = notmuch_query_count_messages (query, &msg_count);
        if (status)
            goto DONE;
 
@@ -1531,7 +1533,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch,
 
        query = notmuch_query_create (notmuch, "");
 
-       status = notmuch_query_search_messages_st (query, &messages);
+       status = notmuch_query_search_messages (query, &messages);
        if (status)
            goto DONE;
        for (;