From 7411f852750c8337006522e56451a1748c7bcbc4 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 11 Jul 2022 00:23:53 +0530 Subject: search: By default, search all documents not just issues. * tissue/search.scm (parse-query): By default, search all documents not just issues. --- tissue/search.scm | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/tissue/search.scm b/tissue/search.scm index 1aafc40..934b2bc 100644 --- a/tissue/search.scm +++ b/tissue/search.scm @@ -31,25 +31,18 @@ (define (parse-query search-query) "Parse SEARCH-QUERY and return a xapian Query object." - (xapian:parse-query - ;; When query does not mention type or state, assume - ;; is:open. Assuming is:open is implicitly assuming type:issue - ;; since only issues can have is:open. - (if (string-null? search-query) - "is:open" - (if (or (string-contains-ci search-query "type:") - (string-contains-ci search-query "is:")) - search-query - (string-append "is:open AND (" search-query ")"))) - #:stemmer (make-stem "en") - #:prefixes '(("type" . "XT") - ("title" . "S") - ("creator" . "A") - ("lastupdater" . "XA") - ("assigned" . "XI") - ("keyword" . "K") - ("tag" . "K") - ("is" . "XS")))) + (if (string-null? search-query) + (Query-MatchAll) + (xapian:parse-query search-query + #:stemmer (make-stem "en") + #:prefixes '(("type" . "XT") + ("title" . "S") + ("creator" . "A") + ("lastupdater" . "XA") + ("assigned" . "XI") + ("keyword" . "K") + ("tag" . "K") + ("is" . "XS"))))) (define* (search-fold proc initial db search-query #:key (offset 0) (maximum-items (database-document-count db))) -- cgit v1.2.3