Writing a full-text search engine in TypeScript
summary
Builds a TypeScript full‑text engine called Lira that runs across Node, Deno, browsers, React Native and Cloudflare Workers, using inverted indexes, prefix trees, Snowball stemming and Levenshtein for typo tolerance. Benchmarks on 1,000,000 IMDb records return queries in ~41 microseconds; supports 23 languages, sharding and msgpack serialization. Deploys indexes to the edge via Nebula with automatic sharding and Lambda/Workers restore. inverted index + prefix trie, 1,000,000 IMDb entries → 41µs searches
AI-written summary · about
chapters (21)
- 0:00Introduction
- 2:27What is fulltext search
- 5:25Tokenization
- 12:53Noble Algorithm
- 14:50Data Structures
- 15:46Hashmap
- 27:27JavaScript runtimes
- 29:53Functional programming vs imperative programming
- 33:27Dynamic programming
- 42:17Edit Distance
- 43:05Lira
- 43:30How it works
- 44:02Search properties
- 45:06Criminal Minds
- 46:41Format
- 47:55Offline search
- 48:11Nebula
- 48:44Lira YAML
- 48:57Schema definition
- 49:52Deployment
- 50:16Data Consistency








