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
Header WASM Index
Compile
Parallel
Compiles while downloading
Performance

Non-Blocking

Runs in a Web Worker. UI stays at 60fps.

Main
Feature

Typo Tolerance

"epilouge" epilogue

Levenshtein DFA with edit distance ≤ 2.

Feature

Substring Search

"sync" finds async__syncthreads

Find terms inside words, not just at boundaries.

Quality
Lean 4 verified
Property tested
25 languages
Title › h2 › h3 › Content
Runtime contracts
Benchmarks

Query performance

Tested on 70 pages of NVIDIA CUTLASS documentation.

Large corpus performance

Tested on 300 pages of PyTorch documentation.

Powers search on harryzorus.xyz.

Use Sorex when

  • Users search for substrings (authauthentication)
  • Typos are common (epilougeepilogue)
  • 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);