]> git.notmuchmail.org Git - notmuch/commitdiff
Invent our own prefix values.
authorCarl Worth <cworth@cworth.org>
Sun, 25 Oct 2009 05:49:35 +0000 (22:49 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 25 Oct 2009 05:57:47 +0000 (22:57 -0700)
We're now dropping all pretense of keeping the database directly
compatible with sup's current xapian backend. (But perhaps someone
might write a new nothmuch backend for sup in the future.)

In coming up with the prefix values here, I tried to follow the
conventions of http://xapian.org/docs/omega/termprefixes.html as
closely as makes sense, (with some domain translation from "web"
to "email archive").

database.cc

index 5b594c024f3e19b8ee0adad3419dfb4e790514e6..928e91ba7585617f9a64c3634b3ef2f39f6a3f0f 100644 (file)
@@ -30,26 +30,35 @@ using namespace std;
 
 #define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0]))
 
 
 #define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0]))
 
-/* These prefix values are specifically chosen to be compatible
- * with sup, (http://sup.rubyforge.org), written by
- * William Morgan <wmorgan-sup@masanjin.net>, and released
- * under the GNU GPL v2.
- */
-
 typedef struct {
     const char *name;
     const char *prefix;
 } prefix_t;
 
 typedef struct {
     const char *name;
     const char *prefix;
 } prefix_t;
 
+/* With these prefix values we follow the conventions published here:
+ *
+ * http://xapian.org/docs/omega/termprefixes.html
+ *
+ * as much as makes sense. Note that I took some liberty in matching
+ * the reserved prefix values to notmuch concepts, (for example, 'G'
+ * is documented as "newsGroup (or similar entity - e.g. a web forum
+ * name)", for which I think the thread is the closest analogue in
+ * notmuch. This in spite of the fact that we will eventually be
+ * storing mailing-list messages where 'G' for "mailing list name"
+ * might be even a closer analogue. I'm treating the single-character
+ * prefixes preferentially for core notmuch concepts (which will be
+ * nearly universal to all mail messages).
+ */
+
 prefix_t BOOLEAN_PREFIX_INTERNAL[] = {
 prefix_t BOOLEAN_PREFIX_INTERNAL[] = {
-    { "type", "K" },
-    { "thread", "H" },
-    { "ref", "R" },
-    { "timestamp", "KTS" },
+    { "type", "T" },
+    { "thread", "G" },
+    { "ref", "XREFERENCE" },
+    { "timestamp", "XTIMESTAMP" },
 };
 
 prefix_t BOOLEAN_PREFIX_EXTERNAL[] = {
 };
 
 prefix_t BOOLEAN_PREFIX_EXTERNAL[] = {
-    { "tag", "L" },
+    { "tag", "K" },
     { "id", "Q" }
 };
 
     { "id", "Q" }
 };