summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-07-11 00:23:53 +0530
committerArun Isaac2022-07-11 00:23:53 +0530
commit7411f852750c8337006522e56451a1748c7bcbc4 (patch)
tree53c3cf95e159a61b29d3b46a22c9e2c3ee235d4d
parentfc8cf0ed8a5bd1507865df888a37ac5e90a46416 (diff)
downloadtissue-7411f852750c8337006522e56451a1748c7bcbc4.tar.gz
tissue-7411f852750c8337006522e56451a1748c7bcbc4.tar.lz
tissue-7411f852750c8337006522e56451a1748c7bcbc4.zip
search: By default, search all documents not just issues.
* tissue/search.scm (parse-query): By default, search all documents not just issues.
-rw-r--r--tissue/search.scm31
1 files 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)))