mirror of https://github.com/M66B/FairEmail.git
FTS5 remove all diacritics
This commit is contained in:
parent
cf098673b4
commit
acb44a6f71
File diff suppressed because it is too large
Load Diff
|
@ -60,7 +60,7 @@ import io.requery.android.database.sqlite.SQLiteDatabase;
|
|||
// https://developer.android.com/topic/libraries/architecture/room.html
|
||||
|
||||
@Database(
|
||||
version = 139,
|
||||
version = 140,
|
||||
entities = {
|
||||
EntityIdentity.class,
|
||||
EntityAccount.class,
|
||||
|
@ -1349,6 +1349,13 @@ public abstract class DB extends RoomDatabase {
|
|||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||
db.execSQL("UPDATE `message` SET fts = 0");
|
||||
}
|
||||
})
|
||||
.addMigrations(new Migration(139, 140) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase db) {
|
||||
Log.i("DB migration from version " + startVersion + " to " + endVersion);
|
||||
db.execSQL("UPDATE `message` SET fts = 0");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ import io.requery.android.database.sqlite.SQLiteOpenHelper;
|
|||
public class FtsDbHelper extends SQLiteOpenHelper {
|
||||
private static FtsDbHelper instance = null;
|
||||
|
||||
private static final int DATABASE_VERSION = 2;
|
||||
private static final int DATABASE_VERSION = 3;
|
||||
private static final String DATABASE_NAME = "fts.db";
|
||||
|
||||
private FtsDbHelper(Context context) {
|
||||
|
@ -54,7 +54,16 @@ public class FtsDbHelper extends SQLiteOpenHelper {
|
|||
public void onCreate(SQLiteDatabase db) {
|
||||
Log.i("FTS create");
|
||||
db.execSQL("CREATE VIRTUAL TABLE `message`" +
|
||||
" USING fts5 (`account` UNINDEXED, `folder` UNINDEXED, `time` UNINDEXED, `address`, `subject`, `keyword`, `text`)");
|
||||
" USING fts5" +
|
||||
" (`account` UNINDEXED" +
|
||||
", `folder` UNINDEXED" +
|
||||
", `time` UNINDEXED" +
|
||||
", `address`" +
|
||||
", `subject`" +
|
||||
", `keyword`" +
|
||||
", `text`" +
|
||||
", tokenize = \"unicode61 remove_diacritics 2\")");
|
||||
// https://www.sqlite.org/fts5.html#unicode61_tokenizer
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue