about summary refs log tree commit diff
diff options
context:
space:
mode:
-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;