search-is-resilient-across-index-states

IN derived (depth 1)

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

Summary

The search feature is designed to work no matter what state the full-text search index is in. Since the index is completely rebuilt every time data is saved, a corrupted or outdated index fixes itself automatically. If the index is missing entirely or throws an error, search gracefully degrades to simple substring matching, so users always get results.

Justifications

SL — A derived (rebuildable) index plus a substring fallback provides index-state-independent search

Antecedents (all must be IN):

  • storage-fts-is-derived-index — The FTS5 full-text search index is rebuilt from scratch during every `save()`; it is a derived index, never the source of truth.
  • search-falls-back-to-substring — `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.

Dependents

These beliefs depend on this one:

Details