search-falls-back-to-substring
IN premise
`api.search()` tries FTS5 full-text search first, then falls back to substring matching if FTS5 tables don't exist or error; it always produces results if substring matches exist.
Summary
The search function has a two-tier strategy: it first attempts a full-text search using FTS5, and if that isn't available or fails, it quietly drops down to simple substring matching. This means search will never return empty-handed just because the full-text index is missing — users will always get results as long as the text appears somewhere, though the quality of ranking may be lower without FTS5.
Dependents
These beliefs depend on this one:
- search-is-resilient-across-index-states — Search operates correctly regardless of FTS5 index availability: the index is derived (rebuilt from scratch on every save) so stale indexes are self-healing, and search falls back to substring matching when FTS tables don't exist or error
Details
| Source | entries/2026/04/24/reasons_lib-api.md |