about summary refs log tree commit diff
path: root/search.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-05-07 19:18:03 -0400
committerJune McEnroe <june@causal.agency>2021-05-07 19:29:21 -0400
commite5eb22a7d447c923e500ba6e490ea78168b203a9 (patch)
treec16d5baea2cfa5a8a842b6716cd7cbe21f9774be /search.c
parentTry to keep query at end of parameters (diff)
downloadscooper-e5eb22a7d447c923e500ba6e490ea78168b203a9.tar.gz
scooper-e5eb22a7d447c923e500ba6e490ea78168b203a9.zip
Reverse order of search results
I guess I didn't realize I could do this with no performance penalty.
Diffstat (limited to 'search.c')
-rw-r--r--search.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/search.c b/search.c
index d2bd4ca..95cac1d 100644
--- a/search.c
+++ b/search.c
@@ -41,6 +41,7 @@ const char *SearchQuery = SQL(
 		AND coalesce(contexts.name = :context, true)
 		AND contexts.query <= NOT :public
 		AND search MATCH :query
+	ORDER BY search.rowid DESC
 	LIMIT :offset, :limit;
 );
 
@@ -90,7 +91,7 @@ enum kcgi_err searchPage(struct kreq *req) {
 			|| khtml_attr(&html, KELEM_TR, KATTR_CLASS, "page", KATTR__MAX)
 			|| khtml_attr(&html, KELEM_TH, KATTR_COLSPAN, "5", KATTR__MAX)
 			|| khtml_attr(&html, KELEM_A, KATTR_HREF, href, KATTR__MAX)
-			|| khtml_puts(&html, "Earlier results")
+			|| khtml_puts(&html, "Later results")
 			|| khtml_closeelem(&html, 3);
 		free(href);
 		if (error) return error;
@@ -138,7 +139,7 @@ enum kcgi_err searchPage(struct kreq *req) {
 			|| khtml_attr(&html, KELEM_TR, KATTR_CLASS, "page", KATTR__MAX)
 			|| khtml_attr(&html, KELEM_TH, KATTR_COLSPAN, "5", KATTR__MAX)
 			|| khtml_attr(&html, KELEM_A, KATTR_HREF, href, KATTR__MAX)
-			|| khtml_puts(&html, "Later results")
+			|| khtml_puts(&html, "Earlier results")
 			|| khtml_closeelem(&html, 3);
 		free(href);
 		if (error) return error;
commit/bin/qf.c?id=9429b55ef96cf7908dc3460e4db5cc1b1a2c84dc&follow=1'>Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe