Repository Public BSD-3-Clause
1# ADR 0006 — Search index: SQLite FTS5 with a grid instead of an R-tree23Date: 2026-11-25 · Status: accepted45**Context.** Offline search needs full-text and spatial lookups in one file per region, small enough to download (§9).67**Decision.** One SQLite file: contentless FTS5 for names, categories and coarse location tokens; places and points of8interest in 0.005° grid cells stored as blobs; street geometry per cell; house numbers and interpolation ranges per9street; a vocabulary table for typo correction. The directive allows "R-tree or equivalent": the R-tree module cost1014.4 MiB for the province against 3.5 MiB for the grid, with no measurable latency benefit at this size.1112**Measured (province of Québec, Mac M5 Max, warm cache).** Index 86.4 MiB for 8 541 places, 275 157 points of interest,13134 053 streets, 1 488 538 addresses; full search p95 3.5 ms, suggestions p95 14.9 ms, reverse geocoding p95 0.5 ms.1415**Consequences.** Only FTS5 is required from the system SQLite. House numbers absent from the data are never16synthesized: the street is returned, flagged "number not found"; `addr:interpolation` positions are flagged as17approximate.18