FTS5 Full-Text Search Index Infrastructure
Component Detail
Infrastructure
medium complexity
mobile
0
Dependencies
2
Dependents
2
Entities
0
Integrations
Description
Manages the SQLite FTS5 virtual table that indexes contact names and note content for fast, offline-capable full-text search. Handles index creation, incremental updates on data mutations, and staleness detection to trigger remote fallback searches when local data is outdated.
fts-index-infrastructure
Responsibilities
- Create and maintain FTS5 virtual table schema for contacts and notes
- Update index incrementally on contact or note insert, update, or delete
- Detect index staleness based on last sync timestamp
- Provide snippet and ranking functions for search result highlighting
- Rebuild index from scratch when corruption is detected
Interfaces
initializeFTSIndex()
updateIndexForContact(Contact contact)
updateIndexForNote(Note note)
removeFromIndex(String entityId)
queryIndex(String query, FTSScope scope)
getSnippet(String entityId, String query)
isIndexStale(DateTime lastSync)
rebuildIndex()
dropIndex()
Relationships
Dependents (2)
Components that depend on this component
Related Data Entities (2)
Data entities managed by this component