Search
Question-first search — answer cards, not just links. Postgres FTS + pg_trgm. Alias/typo tolerant.
1 result for “Jayson” — answer cards first.
entityjason-duval
Jason Duval
See evidence & history →alias_trgm:0.44:jason
How search works
Postgres
full-text search + pg_trgm (trigram) with alias expansion. Query is matched against title, body, and entity_aliases; typo tolerance via similarity() ≥ 0.3 (tunable via CONFIG_KV search:trigram_threshold). Ranking: FTS rank × trigram bonus × alias bonus, deterministic tie-break by slug. Index updates are async via QUEUE_SEARCH_INDEX (60s SLA). No external vendor (Typesense/Algolia/etc.) and no AI free-association.Postgres SQL template is in
src/lib/search.ts:POSTGRES_SEARCH_SQL and src/app/api/search/route.ts; in-memory fixtures mirror it for local dev/tests without Hyperdrive.