Skip to content

Commit 2535cf6

Browse files
authored
feat(data): FTS5 entity search engine (#960)
## Summary - SQLite FTS5 virtual table `entities_fts` indexing seven entity types (projects, vendors, appliances, incidents, quotes, maintenance items, service logs) with porter + unicode61 tokenization. - `RebuildFTSIndex` populates the index from the live entity tables. Safe to call repeatedly; skips soft-deleted rows (own rows and soft-deleted parents in JOINs). - `SearchEntities` runs a MATCH query and returns BM25-ranked results with a stable `entity_id` tiebreaker, capped at 20 rows. - `EntitySummary` fetches a tri-state result (found / stale / missing) so callers can revalidate cached search hits. - `truncateField` clips indexed content by rune count without splitting UTF-8 sequences. This PR is the index and query layer only. No callers are wired up yet — triggers, query hardening, and the eval subcommand land in follow-up PRs. Refs #707
1 parent 777c8c7 commit 2535cf6

2 files changed

Lines changed: 883 additions & 4 deletions

File tree

0 commit comments

Comments
 (0)