]> git.notmuchmail.org Git - notmuch/commitdiff
Trim down prefix list to things we are actually using.
authorCarl Worth <cworth@cworth.org>
Sun, 25 Oct 2009 05:04:59 +0000 (22:04 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 25 Oct 2009 05:04:59 +0000 (22:04 -0700)
I've decided not to try for sup compatibility at the leve of the
xapian datbase. There's just too much about sup's usage of the
database that I don't like, (beyond the embedded ruby data structures
there is redundant storage of message IDs, thread IDs, and dates (in
both terms and values)).

I'm going to fix that up in the database of notmuch, with some other
changes as well. (I plan to drop "reference" terms once linkage to a
thread ID through the reference is established.  I also plan to add
actual documents to represent threads.)

So with all that incompatibility, I might as well make my own prefix
values. And while doing that, I should try to be as compatible as
possible with the conventions described here:

http://xapian.org/docs/omega/termprefixes.html

database.cc

index 7a3019e1de0a708f31c9daba6ca0e81e9144509d..c470cc34977c17beff7d152f78c5f1ac975cefd2 100644 (file)
@@ -41,25 +41,9 @@ typedef struct {
     const char *prefix;
 } prefix_t;
 
     const char *prefix;
 } prefix_t;
 
-prefix_t NORMAL_PREFIX[] = {
-    { "subject", "S" },
-    { "body", "B" },
-    { "from_name", "FN" },
-    { "to_name", "TN" },
-    { "name", "N" },
-    { "attachment", "A" }
-};
-
 prefix_t BOOLEAN_PREFIX[] = {
     { "type", "K" },
 prefix_t BOOLEAN_PREFIX[] = {
     { "type", "K" },
-    { "from_email", "FE" },
-    { "to_email", "TE" },
-    { "email", "E" },
-    { "date", "D" },
-    { "label", "L" },
     { "tag", "L" },
     { "tag", "L" },
-    { "source_id", "I" },
-    { "attachment_extension", "O" },
     { "msgid", "Q" },
     { "thread", "H" },
     { "ref", "R" },
     { "msgid", "Q" },
     { "thread", "H" },
     { "ref", "R" },
@@ -71,10 +55,6 @@ _find_prefix (const char *name)
 {
     unsigned int i;
 
 {
     unsigned int i;
 
-    for (i = 0; i < ARRAY_SIZE (NORMAL_PREFIX); i++)
-       if (strcmp (name, NORMAL_PREFIX[i].name) == 0)
-           return NORMAL_PREFIX[i].prefix;
-
     for (i = 0; i < ARRAY_SIZE (BOOLEAN_PREFIX); i++)
        if (strcmp (name, BOOLEAN_PREFIX[i].name) == 0)
            return BOOLEAN_PREFIX[i].prefix;
     for (i = 0; i < ARRAY_SIZE (BOOLEAN_PREFIX); i++)
        if (strcmp (name, BOOLEAN_PREFIX[i].name) == 0)
            return BOOLEAN_PREFIX[i].prefix;