14 Commits

Author SHA1 Message Date
perfectra1n
7be8b6c71e fix(fts): merge the two migrations into one file 2025-11-28 21:27:01 -08:00
perfectra1n
bb8e5ebd4a fix(fts): fix suggestions from elian 2025-11-28 21:25:24 -08:00
perfectra1n
3957d789da feat(fts5): also create an fts5 index for attributes, and allow them to be searchable using fts5 indexes
Some checks failed
Checks / main (push) Has been cancelled
2025-11-18 13:08:11 -08:00
perf3ct
253da139de
feat(search): try again to get fts5 searching done well
Some checks failed
Checks / main (push) Has been cancelled
2025-10-24 21:47:06 -07:00
perf3ct
d074841885
Revert "feat(search): try to get fts search to work in large environments"
This reverts commit 053f722cb8bcdd8c68af252704cb52fa8df0a5f1.
2025-09-02 19:24:50 +00:00
perf3ct
06b2d71b27
Revert "feat(search): try to decrease complexity"
This reverts commit 5b79e0d71ed9658e82cf050e23625370ec2ea52e.
2025-09-02 19:24:47 +00:00
perf3ct
0afb8a11c8
Revert "feat(search): try to deal with huge dbs, might need to squash later"
This reverts commit 37d0136c500897536e57eb561c881c1bc6d15890.
2025-09-02 19:24:46 +00:00
perf3ct
f529ddc601
Revert "feat(search): further improve fts search"
This reverts commit 7c5553bd4b0784e979e966501c4d9488defe90c5.
2025-09-02 19:24:45 +00:00
perf3ct
7c5553bd4b
feat(search): further improve fts search 2025-09-01 21:40:05 -07:00
perf3ct
37d0136c50
feat(search): try to deal with huge dbs, might need to squash later 2025-09-01 04:33:10 +00:00
perf3ct
5b79e0d71e
feat(search): try to decrease complexity 2025-08-30 22:30:01 -07:00
perf3ct
053f722cb8
feat(search): try to get fts search to work in large environments 2025-08-31 03:15:29 +00:00
perf3ct
21aaec2c38
feat(search): also fix tests for new fts functionality 2025-08-30 20:48:42 +00:00
perf3ct
1db4971da6
feat(search): implement FST5 w/ sqlite for faster and better searching
feat(search): don't limit the number of blobs to put in virtual tables

fix(search): improve FTS triggers to handle all SQL operations correctly

The root cause of FTS index issues during import was that database triggers
weren't properly handling all SQL operations, particularly upsert operations
(INSERT ... ON CONFLICT ... DO UPDATE) that are commonly used during imports.

Key improvements:
- Fixed INSERT trigger to handle INSERT OR REPLACE operations
- Updated UPDATE trigger to fire on ANY change (not just specific columns)
- Improved blob triggers to use INSERT OR REPLACE for atomic updates
- Added proper handling for notes created before their blobs (import scenario)
- Added triggers for protection state changes
- All triggers now use LEFT JOIN to handle missing blobs gracefully

This ensures the FTS index stays synchronized even when:
- Entity events are disabled during import
- Notes are re-imported (upsert operations)
- Blobs are deduplicated across notes
- Notes are created before their content blobs

The solution works entirely at the database level through triggers,
removing the need for application-level workarounds.

fix(search): consolidate FTS trigger fixes into migration 234

- Merged improved trigger logic from migration 235 into 234
- Deleted unnecessary migration 235 since DB version is still 234
- Ensures triggers handle all SQL operations (INSERT OR REPLACE, upserts)
- Fixes FTS indexing for imported notes by handling missing blobs
- Schema.sql and migration 234 now have identical trigger implementations
2025-08-30 20:39:40 +00:00