Typo-tolerant catalogue search across 2.1 million SKUs, self-hosted.
Northwind paid a hosted search vendor $9,400 a month and still lost every query with a typo in it. “cordless drll” returned nothing, and the analytics said 6.8% of all searches were spelled wrong.
The vendor’s p95 was 480ms from the edge, but reindexing a price change took eleven minutes — so the site regularly advertised a price the basket disagreed with.
I built the index in Rust over a trigram-backed Postgres table, with a bounded Levenshtein pass for the typo case and Redis holding the hot query set.
Price and stock stopped going through the index entirely. Those two fields are read from the source of truth at render time and merged into the result, so a price change is visible on the next request rather than the next reindex.
Relevance became a tuning console rather than a config file. Merchandisers compare two rankings side by side and promote one, which removed engineering from a loop it was never adding anything to.
p95 latency landed at 71ms — 6.8× faster — and typo queries now convert at 91% of the rate of correctly-spelled ones, up from zero.
The hosted contract was not renewed. Self-hosting costs about $340 a month in compute.
480ms → 71ms
p95 search latency
$9,400/mo → $340/mo
Search spend
11 min → next request
Price staleness