From 3f7eb2f0e3a5bdb925e025d13e08901e92ce8f06 Mon Sep 17 00:00:00 2001 From: ghost Date: Mon, 27 Nov 2023 20:18:43 +0200 Subject: [PATCH] show random results on empty search request --- src/webui/search.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/webui/search.php b/src/webui/search.php index 6f468e2..faa0cb7 100644 --- a/src/webui/search.php +++ b/src/webui/search.php @@ -105,6 +105,12 @@ if ($config->webui->search->index->request->url->enabled && filter_var($q, FILTE // Extended syntax corrections switch (true) { + case empty($q): + + $query = $index->search('')->sort('RAND()'); + + break; + case filter_var($q, FILTER_VALIDATE_URL): $query = $index->search('')->filter('crc32url', crc32($q));