From e5eb22a7d447c923e500ba6e490ea78168b203a9 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 7 May 2021 19:18:03 -0400 Subject: Reverse order of search results I guess I didn't realize I could do this with no performance penalty. --- search.c | 5 +++-- 1 file 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; -- cgit 1.4.1