mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 09:13:23 +00:00
The set of event kinds that implement SearchableEvent — and the text each contributes via indexableContent() — is baked into the quartz build, so it changes across app versions. Events stored under older code keep their old (or missing) NIP-50 full-text-search rows, so search silently misses them after an upgrade. Add IEventStore.reindexFullTextSearch() so the app can wipe and rebuild the FTS index from already-stored events when it has spare cycles. Speed: only kinds that currently map to a SearchableEvent are scanned. Kind alone selects the event class in EventFactory, so a single probe per distinct kind is authoritative, letting us push a `kind IN (...)` filter (SQLite) / skip whole idx/kind dirs (filesystem) so the non-searchable bulk — reactions, zaps, follow lists — is never deserialised. - SQLite: FullTextSearchModule.reindexAll drops+recreates the virtual table (O(1) wipe) then streams only searchable-kind rows in one write transaction, reusing a single INSERT statement. - Filesystem: rebuilds only idx/fts/, driving the walk from idx/kind/<searchable kind>/ via the new FsIndexer.linkFts. - Wrappers (EventStore, ObservableEventStore, InterningEventStore) delegate; the observable layer emits nothing since no event changes. - cli: `amy store reindex-fts`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BZqPFds2TPPUKkMmBngwys