Esc

Start typing to search the docs

Search

Five interchangeable backends behind one switch: Pagefind, Orama, FlexSearch, Typesense, and Chroma.

2 min read · 339 words

Picking a backend

SVOCS ships five interchangeable search backends behind one switch: Pagefind (the zero-config default), Orama, FlexSearch, Typesense, and Chroma. The docs UI (the ⌘K dialog, keyboard navigation, result rendering) is identical no matter which one is active; only how the index gets built and queried changes.

Set PUBLIC_SVOCS_SEARCH_PROVIDER at build time to switch:

PUBLIC_SVOCS_SEARCH_PROVIDER=orama bun run build

Leave it unset and you get Pagefind, which needs no configuration and no extra process.

The three shapes

BackendHow the index is builtWho runs itLive server?
PagefindWASM search index generated from your built HTMLA post-build CLI stepNo
OramaRaw page content shipped as static JSON, indexed in-browserPart of the static buildNo
FlexSearchSame idea, different in-browser index libraryPart of the static buildNo
TypesenseContent pushed to a collection on your Typesense serverA sync script after the buildYes, self-hosted or cloud
ChromaContent pushed to a collection on your Chroma server (semantic search — server embeds it for you)A sync script after the buildYes, self-hosted

Pagefind, Orama, and FlexSearch keep the site fully static: there is no search server to host, so there’s also nothing that can go down. Typesense and Chroma trade that away for a live, queryable server, which buys better relevance tuning and (for Chroma) semantic search, at the cost of standing up and securing a service the browser talks to directly.

Adding a backend to a scaffolded project

create-svocs-docs only ships Pagefind by default, to keep a fresh scaffold’s install small. The other four backends are documented, working code you copy in when you actually want them. Each backend’s page below has the exact files and the one package to install.