try {
status = find_timestamp_document (notmuch, db_key, &doc, &doc_id);
- doc.add_value (0, Xapian::sortable_serialise (timestamp));
+ doc.add_value (NOTMUCH_VALUE_TIMESTAMP,
+ Xapian::sortable_serialise (timestamp));
if (status == NOTMUCH_PRIVATE_STATUS_NO_DOCUMENT_FOUND) {
char *term = talloc_asprintf (NULL, "%s%s",
if (status == NOTMUCH_PRIVATE_STATUS_NO_DOCUMENT_FOUND)
goto DONE;
- ret = Xapian::sortable_unserialise (doc.get_value (0));
+ ret = Xapian::sortable_unserialise (doc.get_value (NOTMUCH_VALUE_TIMESTAMP));
} catch (Xapian::Error &error) {
goto DONE;
}
time_value = notmuch_parse_date (date, NULL);
- message->doc.add_value (NOTMUCH_VALUE_DATE,
+ message->doc.add_value (NOTMUCH_VALUE_TIMESTAMP,
Xapian::sortable_serialise (time_value));
}
#endif
#endif
-/* These value numbers are chosen to be sup compatible (for now at
- * least). */
-
typedef enum {
- NOTMUCH_VALUE_MESSAGE_ID = 0,
- NOTMUCH_VALUE_THREAD = 1,
- NOTMUCH_VALUE_DATE = 2
+ NOTMUCH_VALUE_TIMESTAMP = 0,
+ NOTMUCH_VALUE_MESSAGE_ID,
+ NOTMUCH_VALUE_THREAD
} notmuch_value_t;
/* Xapian (with flint backend) complains if we provide a term longer
switch (query->sort) {
case NOTMUCH_SORT_DATE_OLDEST_FIRST:
- enquire.set_sort_by_value (NOTMUCH_VALUE_DATE, FALSE);
+ enquire.set_sort_by_value (NOTMUCH_VALUE_TIMESTAMP, FALSE);
break;
case NOTMUCH_SORT_DATE_NEWEST_FIRST:
- enquire.set_sort_by_value (NOTMUCH_VALUE_DATE, TRUE);
+ enquire.set_sort_by_value (NOTMUCH_VALUE_TIMESTAMP, TRUE);
break;
case NOTMUCH_SORT_MESSAGE_ID:
enquire.set_sort_by_value (NOTMUCH_VALUE_MESSAGE_ID, FALSE);