Fixed fts4 search suggestions

This commit is contained in:
M66B 2022-09-26 09:42:24 +02:00
parent 8ee88255ac
commit 3d63052820
1 changed files with 2 additions and 1 deletions

View File

@ -137,7 +137,8 @@ public class Fts4DbHelper extends SQLiteOpenHelper {
try (Cursor cursor = db.rawQuery(
"SELECT term FROM message_terms" +
" WHERE term LIKE ?" +
" ORDER BY occurrences DESC" +
" GROUP BY term" +
" ORDER BY SUM(occurrences) DESC" +
" LIMIT " + max,
new String[]{query})) {
while (cursor != null && cursor.moveToNext())