Avoid alias when matching FTS table
This commit is contained in:
parent
8111d8985e
commit
6d00906fc9
1 changed files with 10 additions and 10 deletions
20
script.js
20
script.js
|
@ -877,8 +877,8 @@
|
|||
const searchSql = {
|
||||
rank: `
|
||||
SELECT t.id, a.name AS artist, t.title, IFNULL(al.title, '') AS album, t.year, t.genre
|
||||
FROM fts_tracks f
|
||||
JOIN tracks t ON t.id = f.rowid
|
||||
FROM fts_tracks
|
||||
JOIN tracks t ON t.id = fts_tracks.rowid
|
||||
JOIN artists a ON a.id = t.artist_id
|
||||
LEFT JOIN albums al ON al.id = t.album_id
|
||||
WHERE fts_tracks MATCH ?
|
||||
|
@ -887,8 +887,8 @@
|
|||
`,
|
||||
alpha: `
|
||||
SELECT t.id, a.name AS artist, t.title, IFNULL(al.title, '') AS album, t.year, t.genre
|
||||
FROM fts_tracks f
|
||||
JOIN tracks t ON t.id = f.rowid
|
||||
FROM fts_tracks
|
||||
JOIN tracks t ON t.id = fts_tracks.rowid
|
||||
JOIN artists a ON a.id = t.artist_id
|
||||
LEFT JOIN albums al ON al.id = t.album_id
|
||||
WHERE fts_tracks MATCH ?
|
||||
|
@ -898,8 +898,8 @@
|
|||
};
|
||||
const countSql = `
|
||||
SELECT COUNT(*) AS count
|
||||
FROM fts_tracks f
|
||||
JOIN tracks t ON t.id = f.rowid
|
||||
FROM fts_tracks
|
||||
JOIN tracks t ON t.id = fts_tracks.rowid
|
||||
JOIN artists a ON a.id = t.artist_id
|
||||
LEFT JOIN albums al ON al.id = t.album_id
|
||||
WHERE fts_tracks MATCH ?
|
||||
|
@ -1102,8 +1102,8 @@
|
|||
const ftsCountSql = `
|
||||
SELECT COUNT(*) AS count FROM (
|
||||
SELECT a.id
|
||||
FROM fts_tracks f
|
||||
JOIN tracks t ON t.id = f.rowid
|
||||
FROM fts_tracks
|
||||
JOIN tracks t ON t.id = fts_tracks.rowid
|
||||
JOIN artists a ON a.id = t.artist_id
|
||||
WHERE fts_tracks MATCH ?
|
||||
GROUP BY a.id
|
||||
|
@ -1111,8 +1111,8 @@
|
|||
`;
|
||||
const ftsRowsSql = `
|
||||
SELECT a.id, a.name
|
||||
FROM fts_tracks f
|
||||
JOIN tracks t ON t.id = f.rowid
|
||||
FROM fts_tracks
|
||||
JOIN tracks t ON t.id = fts_tracks.rowid
|
||||
JOIN artists a ON a.id = t.artist_id
|
||||
WHERE fts_tracks MATCH ?
|
||||
GROUP BY a.id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue