Add kana independent search with tamerye extension

This commit is contained in:
2026-06-04 02:00:00 +09:00
parent a46d61c335
commit ef491a0977
7 changed files with 124 additions and 15 deletions
+3 -3
View File
@@ -67,14 +67,14 @@ String _filterFTSSensitiveCharacters(String word) {
SELECT DISTINCT
"$tableName"."entryId",
100
+ (("${tableName}FTS"."reading" = ?) * 10000)
+ (("${tableName}FTS"."reading" = normalize_jp(?)) * 10000)
+ (("$tableName"."orderNum" = 0) * 20)
+ COALESCE("JMdict_EntryScore"."score", 0)
AS "score"
FROM "${tableName}FTS"
JOIN "$tableName" USING ("elementId")
LEFT JOIN "JMdict_EntryScore" USING ("elementId")
WHERE "${tableName}FTS"."reading" MATCH ? || '*'
WHERE "${tableName}FTS"."reading" MATCH normalize_jp(?) || '*'
),
non_fts_results AS (
SELECT DISTINCT
@@ -85,7 +85,7 @@ String _filterFTSSensitiveCharacters(String word) {
AS "score"
FROM "$tableName"
LEFT JOIN "JMdict_EntryScore" USING ("elementId")
WHERE "reading" LIKE '%' || ? || '%'
WHERE "reading" LIKE '%' || normalize_jp(?) || '%'
AND "$tableName"."entryId" NOT IN (SELECT "entryId" FROM "fts_results")
)
+1 -1
View File
@@ -1 +1 @@
const int jadbSchemaVersion = 1;
const int jadbSchemaVersion = 2;