word_search: remove duplicate results

This commit is contained in:
2025-07-07 12:47:20 +02:00
parent 7978b74f8d
commit ac7deae608

View File

@@ -82,12 +82,13 @@ String _filterFTSSensitiveCharacters(String word) {
${!countOnly ? 'LIMIT ?' : ''}
)
${countOnly ? 'SELECT COUNT("entryId") AS count' : 'SELECT "entryId", "score"'}
${countOnly ? 'SELECT COUNT("entryId") AS count' : 'SELECT "entryId", MAX("score") AS "score"'}
FROM (
SELECT * FROM fts_results
UNION ALL
UNION
SELECT * FROM non_fts_results
)
GROUP BY "entryId"
'''
.trim(),
[