mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-25 18:35:06 +01:00
Added option to enable sqlite unicode61 tokenizer
This commit is contained in:
@@ -56,8 +56,9 @@ public class Fts4DbHelper extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
static SQLiteDatabase getInstance(Context context) {
|
||||
if (instance == null) {
|
||||
if (!context.getDatabasePath(DATABASE_NAME).exists()) {
|
||||
boolean exists = context.getDatabasePath(DATABASE_NAME).exists();
|
||||
if (instance == null || !exists) {
|
||||
if (!exists) {
|
||||
Fts5DbHelper.delete(context);
|
||||
DB.getInstance(context).message().resetFts();
|
||||
}
|
||||
@@ -73,8 +74,8 @@ public class Fts4DbHelper extends SQLiteOpenHelper {
|
||||
// https://www.sqlite.org/fts3.html#tokenizer
|
||||
// https://unicode.org/reports/tr29/
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean unicode61 = prefs.getBoolean("unicode61", BuildConfig.DEBUG);
|
||||
String tokenizer = (unicode61 ? "tokenize=unicode61 \"remove_diacritics=0\"" : null);
|
||||
boolean unicode61 = prefs.getBoolean("sqlite_unicode61", false);
|
||||
String tokenizer = (unicode61 ? "tokenize=unicode61 \"remove_diacritics=2\"" : null);
|
||||
|
||||
db.execSQL("CREATE VIRTUAL TABLE `message`" +
|
||||
" USING fts4" +
|
||||
|
||||
Reference in New Issue
Block a user