MIN_DATE |
= |
Time.at 0 |
|
dates are converted to integers for xapian, and are used for document ids,
so we must ensure they‘re reasonably valid. this typically only
affect spam.
|
NORMAL_PREFIX |
= |
{ 'subject' => 'S', 'body' => 'B', 'from_name' => 'FN', 'to_name' => 'TN', 'name' => 'N', 'attachment' => 'A', } |
|
Stemmed
|
BOOLEAN_PREFIX |
= |
{ 'type' => 'K', 'from_email' => 'FE', 'to_email' => 'TE', 'email' => 'E', 'date' => 'D', 'label' => 'L', 'source_id' => 'I', 'attachment_extension' => 'O', 'msgid' => 'Q', 'thread' => 'H', 'ref' => 'R', } |
|
Unstemmed
|
PREFIX |
= |
NORMAL_PREFIX.merge BOOLEAN_PREFIX |
DOCID_SCALE |
= |
2.0**32 |
|
Xapian can very efficiently sort in ascending
docid order. Sup always wants to sort by descending date, so this method
maps between them. In order to handle multiple messages per second, we use
a logistic curve centered around MIDDLE_DATE so that the slope (docid/s) is
greatest in this time period. A docid collision is not an error - the code
will pick the next smallest unused one.
|