@hatk/hatk 0.0.1-alpha.45 → 0.0.1-alpha.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -61,7 +61,7 @@ export class SQLiteSearchPort {
|
|
|
61
61
|
await this.port.execute(`INSERT INTO ${shadowTable}_fts(${shadowTable}_fts, rowid, uri, ${colList}) VALUES('delete', $1, $2, ${placeholders.join(', ')})`, [old.rowid, uri, ...searchColumns.map((c) => old[c] ?? '')]);
|
|
62
62
|
}
|
|
63
63
|
async search(shadowTable, query, _searchColumns, limit, offset) {
|
|
64
|
-
const escaped = query.replace(/['"*(){}[\]
|
|
64
|
+
const escaped = query.replace(/['"*(){}[\]^~\\:.]/g, ' ').trim();
|
|
65
65
|
if (!escaped)
|
|
66
66
|
return [];
|
|
67
67
|
const sql = `SELECT uri, -bm25(${shadowTable}_fts) AS score
|