Skip to content

Commit

Permalink
storage/mariadb: sort search by tracks.priority
Browse files Browse the repository at this point in the history
  • Loading branch information
Wessie committed Jun 17, 2024
1 parent 680e6b8 commit de33168
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions storage/mariadb/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -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;
`

Expand Down

0 comments on commit de33168

Please sign in to comment.