feat(15-01): migrate FTS5 search_index to contentless_delete=1

- Add contentless_delete=1 to search_index.sql schema file
- Update ClearSearchIndex CREATE statement to match schema
- Replace DeleteSearchIndex no-op with real DELETE WHERE rowid
- Add migration 8: drop/recreate/repopulate FTS5 table
- Update library.go comment about FTS entry lifecycle
This commit is contained in:
2026-03-16 18:10:57 -04:00
parent 73d9be8e26
commit cb5155b890
4 changed files with 96 additions and 15 deletions
+4 -5
View File
@@ -1077,11 +1077,10 @@ func (l *Library) updateAudioFileMetadata(
}
// Re-index in FTS5 search_index.
// Contentless FTS5 (content='') does not support DELETE, so we
// cannot remove the old entry. Inserting a new row with the
// same rowid is accepted by FTS5 — the old entry becomes stale
// but harmless (search JOINs against track_metadata filter it).
// The index is fully rebuilt during FullRescan.
// With contentless_delete=1 (migration 8), DeleteSearchIndex
// now works for individual row removal. For scan updates we
// still do delete + reinsert; Phase 16 will use the same
// pattern for inline tag edits.
tags := result.tags
if tags == nil {
tags = &metadata.TrackMetadata{}