diff options
author | Arun Isaac | 2022-06-26 01:32:13 +0530 |
---|---|---|
committer | Arun Isaac | 2022-06-27 00:19:36 +0530 |
commit | 650642b4cf43b4390c1332c930124eda88ea4109 (patch) | |
tree | 476560b80c22281ddf1b7e01d96b7f7a7c5bcfb6 /bin | |
parent | a27e3cb2975421b0cb23a4dbe3daa2f7507df055 (diff) | |
download | tissue-650642b4cf43b4390c1332c930124eda88ea4109.tar.gz tissue-650642b4cf43b4390c1332c930124eda88ea4109.tar.lz tissue-650642b4cf43b4390c1332c930124eda88ea4109.zip |
bin: Assume is:open in queries.
* bin/tissue (tissue-search): Assume is:open in queries.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/tissue | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -176,14 +176,20 @@ Search issues using SEARCH-QUERY. (call-with-database %xapian-index (lambda (db) (let* ((stemmer (make-stem "en")) - (query-string (string-join args)) (query (parse-query - ;; If issue state is not mentioned in query, - ;; assume is:open. - (cond - ((string-null? query-string) "is:open") - ((string-contains-ci query-string "is:") query-string) - (else (format #f "is:open AND (~a)" query-string))) + ;; 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 (every string-null? args) + "is:open" + (string-join (if (any (lambda (query-string) + (or (string-contains-ci query-string "type:") + (string-contains-ci query-string "is:"))) + args) + args + (cons "is:open" args)) + " AND ")) #:stemmer stemmer #:prefixes '(("type" . "XT") ("title" . "S") |