summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mumi/xapian.scm13
1 files changed, 9 insertions, 4 deletions
diff --git a/mumi/xapian.scm b/mumi/xapian.scm
index 8024c6d..9c594d6 100644
--- a/mumi/xapian.scm
+++ b/mumi/xapian.scm
@@ -272,10 +272,15 @@ intact."
(lambda (db)
(let* ((querystring*
(string-join (map (lambda (token)
- (if (or (string-prefix? "date:" token)
- (string-prefix? "mdate:" token))
- (sanitize-date-range token)
- token))
+ (cond
+ ((or (string-prefix? "date:" token)
+ (string-prefix? "mdate:" token))
+ (sanitize-date-range token))
+ ((string-prefix? "msgid:" token)
+ (let ((msgid (substring token (string-length "msgid:"))))
+ (format #false "msgid:~a"
+ (string-hash msgid))))
+ (else token)))
(tokenize querystring))))
;; Parse querystring passing a stemmer and suitable
;; prefixes for field search.