summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2020-04-22 15:02:22 +0200
committerRicardo Wurmus <rekado@elephly.net>2020-04-22 15:02:22 +0200
commitea75147f0fe10e947139f424fc08179a31ebfa33 (patch)
treeb84ef5e3ab34ffa698c9aa3f2a11c6c090d1b1e9
parentaf553d028b7f81d7cb8fcbcf5c289ea4da186a31 (diff)
messages: Use xapian search.
-rw-r--r--mumi/messages.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/mumi/messages.scm b/mumi/messages.scm
index 24bd495..5a6ca34 100644
--- a/mumi/messages.scm
+++ b/mumi/messages.scm
@@ -33,6 +33,7 @@
#:use-module (email email)
#:use-module (mumi config)
#:use-module (mumi debbugs)
+ #:use-module (mumi xapian)
#:use-module ((mumi bugs) #:prefix db:)
#:use-module (web client)
#:export (search-bugs
@@ -175,8 +176,8 @@ result for a while."
"Return a list of all bugs matching the given QUERY string.
Intersect the result with the id sets in the list SETS."
(let* ((ids (delete-duplicates
- (map (compose string->number mu:bugid)
- (mu:message-list query))))
+ (map string->number
+ (search query))))
(filtered (match sets
(() ids)
(_ (apply lset-intersection eq? ids sets)))))
@@ -196,8 +197,8 @@ Intersect the result with the id sets in the list SETS."
(let* ((recent-ids
(sort
(delete-duplicates
- (map (compose string->number mu:bugid)
- (mu:message-list "date:1m..")))
+ (map string->number
+ (search "mdate:1m..")))
<))
(ids (take (reverse recent-ids)
(min amount (length recent-ids)))))