From de331689c5f04dacffc2a8eb2b340db835a462c7 Mon Sep 17 00:00:00 2001 From: Wessie Date: Mon, 17 Jun 2024 20:26:04 +0100 Subject: [PATCH] storage/mariadb: sort search by tracks.priority --- storage/mariadb/search.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/storage/mariadb/search.go b/storage/mariadb/search.go index 52fef104..3ad915d4 100644 --- a/storage/mariadb/search.go +++ b/storage/mariadb/search.go @@ -29,18 +29,17 @@ FROM (SELECT *, MATCH (artist, track, album, tags) AGAINST (? IN BOOLEAN MODE) score FROM tracks HAVING score > 0 - ORDER BY score DESC LIMIT ? OFFSET ?) AS tracks JOIN esong ON esong.hash = tracks.hash ORDER BY - score DESC; + priority DESC, score DESC; `) var searchTotalQuery = ` SELECT COUNT(*) FROM (SELECT *, MATCH (artist, track, album, tags) AGAINST (? IN BOOLEAN MODE) score - FROM tracks + FROM tracks HAVING score > 0) AS tracks; `