Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

core: use porter trigram tokenizer for fts

Abdullah Atta6b6e903322dc
diff --git a/packages/core/src/database/migrations.ts b/packages/core/src/database/migrations.ts
index 75c15c760..bfafc0164 100644
--- a/packages/core/src/database/migrations.ts
+++ b/packages/core/src/database/migrations.ts
@@ -289,7 +289,9 @@ async function createFTS5Table(
const new_indexed_cols = sql.raw(indexedColumns.join(", new."));
const old_indexed_cols = sql.raw(indexedColumns.join(", old."));
await sql`CREATE VIRTUAL TABLE ${ref_fts} USING fts5(
- id UNINDEXED, ${unindexed_cols} ${indexed_cols}, content='${sql.raw(table)}'
+ id UNINDEXED, ${unindexed_cols} ${indexed_cols}, content='${sql.raw(
+ table
+ )}', tokenize='porter trigram'
)`.execute(db);
insertConditions = [
"(new.deleted is null or new.deleted == 0)",