v1.0.9 153KB WASM 17KB JS
Sorex
search that actually finds things
Most search libraries can't find "auth" in "authentication."
Sorex can. It handles typos, finds substrings, and proves its ranking correct.
search
Loading search index...
Architecture
Progressive Search
All tiers run in parallel. Results stream as each completes.
T1 Exact ~5μs 3
→T2 Prefix ~10μs +5
→T3 Fuzzy ~200μs +2
Performance
Parallel Loading
WASM compiles while index downloads. Threading when available.
Network
Compile
Compiles while downloading
Performance
Non-Blocking
Runs in a Web Worker. UI stays at 60fps.
Main
Worker
Feature
Typo Tolerance
"epilouge" → epilogueLevenshtein DFA with edit distance ≤ 2.
Feature
Substring Search
"sync" finds async__syncthreadsFind terms inside words, not just at boundaries.
Quality
Lean 4 verified
Property tested
25 languages
Title › h2 › h3 › Content
Runtime contracts
Large corpus performance
Tested on 300 pages of PyTorch documentation.
Powers search on harryzorus.xyz.
Use Sorex when
- Users search for substrings (
auth→authentication) - Typos are common (
epilouge→epilogue) - You need section-aware ranking
- You need provably correct ranking
Don't use Sorex when
- Minimal bundle size is critical (Sorex: ~153KB, FlexSearch: 6.6KB)
- You only need exact word matching
- Dataset is under 10 docs (use array.filter())
- You need server-side search (try Meilisearch)
Quick Start
CLI
$ cargo install sorex
$ sorex index --input ./docs --output ./search
$ sorex search --wasm ./search/index.sorex "tensor"
app.js
import { loadSorex } from './sorex.js';
const searcher = await loadSorex('./index.sorex');
searcher.search('tensor', 10, ui_callback);