X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fdatabase.cc;h=09ab9cb037475f7e07a4af5d3ac6dc975c25919e;hb=d9800c893289b56dcc966241528643ae83f2ff9a;hp=9cf8062cbe7caa2c5f7ecd714ca934c7f96b1e76;hpb=f7130468d27c4f37d45e6aa60baacfc3329ccff4;p=notmuch diff --git a/lib/database.cc b/lib/database.cc index 9cf8062c..09ab9cb0 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -63,14 +63,19 @@ typedef struct { * We currently have three different types of documents (mail, ghost, * and directory) and also some metadata. * + * There are two kinds of prefixes used in notmuch. There are the + * human friendly 'prefix names' like "thread:", which are also used + * in the query parser, and the actual prefix terms in the database + * (e.g. "G"). The correspondence is maintained in the file scope data + * structure 'prefix_table'. + * * Mail document * ------------- * A mail document is associated with a particular email message. It - * is stored in one or more files on disk (though only one has its - * content indexed) and is uniquely identified by its "id" field - * (which is generally the message ID). It is indexed with the - * following prefixed terms which the database uses to construct - * threads, etc.: + * is stored in one or more files on disk and is uniquely identified + * by its "id" field (which is generally the message ID). It is + * indexed with the following prefixed terms which the database uses + * to construct threads, etc.: * * Single terms of given prefix: * @@ -119,9 +124,11 @@ typedef struct { * * In addition, terms from the content of the message are added with * "from", "to", "attachment", and "subject" prefixes for use by the - * user in searching. Similarly, terms from the path of the mail - * message are added with "folder" and "path" prefixes. But the - * database doesn't really care itself about any of these. + * user in searching. + * + * The path of the containing folder is added with the "folder" prefix + * (see _notmuch_message_add_folder_terms). Sub-paths of the the path + * of the mail message are added with the "path" prefix. * * The data portion of a mail document is empty. *