summaryrefslogtreecommitdiff
path: root/issues
diff options
context:
space:
mode:
authorArun Isaac2022-07-13 18:17:52 +0530
committerArun Isaac2022-07-19 17:37:07 +0530
commite00d944a93c92d401fa85ddf21b60f852bdd41f9 (patch)
treeb02fe2259f4682e4153311ad02e60d9020e61b7a /issues
parentf7170b4f5502f5aeb30620a2df4fc5a3049e9a95 (diff)
downloadtissue-e00d944a93c92d401fa85ddf21b60f852bdd41f9.tar.gz
tissue-e00d944a93c92d401fa85ddf21b60f852bdd41f9.tar.lz
tissue-e00d944a93c92d401fa85ddf21b60f852bdd41f9.zip
search: Sort by date on strictly boolean queries.
* issues/sort-by-date.gmi: Close issue. * tissue/search.scm (term-ref, query-terms-every): New functions. (boolean-query?): New public function. (search-fold): Sort by date on strictly boolean queries. * tissue/web/server.scm (handler): Sort by date on strictly boolean queries.
Diffstat (limited to 'issues')
-rw-r--r--issues/sort-by-date.gmi6
1 files changed, 6 insertions, 0 deletions
diff --git a/issues/sort-by-date.gmi b/issues/sort-by-date.gmi
index caa9ae7..8df8cc7 100644
--- a/issues/sort-by-date.gmi
+++ b/issues/sort-by-date.gmi
@@ -3,3 +3,9 @@
* tags: enhancement
The search page with a blank query doubles as a listing of all issues and documents. So, it is nicer if that listing is ordered by creation date. With actual non-blank search queries, it is ok to sort by relevance as we already do.
+
+## Resolution
+
+This is now implemented both for the web UI and the CLI. It was a bit more involved than first met the eye. We had to sort by date not just for "blank queries", but for all queries that had only boolean search terms---for example, "tag:enhancement" and "tag:enhancement AND type:issue AND is:open". To do this, we first indexed boolean terms as such. Earlier, we were indexing them as free text. Then, we parsed search queries with some prefixes being marked out as boolean prefixes. Finally, we iterated through the terms in parsed queries and checked if they were all boolean terms. If they were, then we sorted results by date.
+
+* closed