Integration #
Pizza is designed to embed, not just deploy. The same engine library that powers the server compiles to WebAssembly and to native targets, so search can run where your data already lives — the browser, an edge worker, a mobile app, or another Rust service.
Pizza WASM #
The engine ships in four tiers — pick the smallest that covers your query
surface. Every tier loads the same .fire segment format the server
persists, so segments exported from a node mount unchanged in the browser.
| Tier | Size (gzip) | What it adds |
|---|---|---|
nano | ~185 KB | Text search only (term/match/phrase/bool and friends). No JSON parsing — typed API. |
micro | a bit more | + geo, vector, query-string, graph traversal, zstd segments. Still typed API. |
mini | more | + JSON DSL parsing and remote segment fetch — drive it with the same query JSON as the server. |
ultra | full | + aggregations, regex queries, scripting — the tier behind the docs playground. |
The PizzaEngine API
#
Every tier exposes the same surface (pizza_engine.js from wasm-pack):
import init, { PizzaEngine } from './pizza_engine.js';
await init(); // instantiate the module once
const engine = new PizzaEngine(schemaJson); // properties map of the collection
const docs = engine.mount(new Uint8Array(bytes)); // mount a .fire segment (returns doc count)
engine.unmount_all();
const out = engine.search_with_dsl(dslJson); // full JSON DSL — mini and up
const typed = engine.search(queryJson, k); // typed query object — all tiers
engine.explain_query(dslJson); // execution plan
engine.search_with_query_string('level:error AND timeout', '*', 'AND');
mountaccepts full bytes;mount_url/mount_remotefetch segments over HTTP (mini and up),mount_sparsestreams with a read callback.search_with_dslreturns engine-level output — no gateway envelope.- The
playground page is a live
ultrainstance; its dataset is built bymake dataset-fire, its bundle bymake wasm.
Where to get it #
The wrapper lives at pizza-wasm (MIT).
Companion tools #
- Pizza CLI — interactive terminal for a running node.
- Pizza docsearch — a drop-in search box for static sites, powered by Pizza WASM.
- Pizza stemmer — Snowball stemmers for 30+ languages.
- Pizza jieba — Chinese tokenizer.
Embedding natively #
The engine is a normal Rust crate (pizza-engine). Server, CLI and wasm
builds are three feature sets of one library — see the repository README for
the feature matrix (persistence, graph, aggs, geo_queries,
vector_queries, …) and the ShardedConfig presets for sizing.