mirror of
https://github.com/YGGverse/Yo.git
synced 2026-03-31 17:55:35 +00:00
show random results on empty search request
This commit is contained in:
parent
6a9117757b
commit
3f7eb2f0e3
1 changed files with 6 additions and 0 deletions
|
|
@ -105,6 +105,12 @@ if ($config->webui->search->index->request->url->enabled && filter_var($q, FILTE
|
||||||
// Extended syntax corrections
|
// Extended syntax corrections
|
||||||
switch (true)
|
switch (true)
|
||||||
{
|
{
|
||||||
|
case empty($q):
|
||||||
|
|
||||||
|
$query = $index->search('')->sort('RAND()');
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case filter_var($q, FILTER_VALIDATE_URL):
|
case filter_var($q, FILTER_VALIDATE_URL):
|
||||||
|
|
||||||
$query = $index->search('')->filter('crc32url', crc32($q));
|
$query = $index->search('')->filter('crc32url', crc32($q));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue