Integration

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.

TierSize (gzip)What it adds
nano~185 KBText search only (term/match/phrase/bool and friends). No JSON parsing — typed API.
microa bit more+ geo, vector, query-string, graph traversal, zstd segments. Still typed API.
minimore+ JSON DSL parsing and remote segment fetch — drive it with the same query JSON as the server.
ultrafull+ 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');
  • mount accepts full bytes; mount_url / mount_remote fetch segments over HTTP (mini and up), mount_sparse streams with a read callback.
  • search_with_dsl returns engine-level output — no gateway envelope.
  • The playground page is a live ultra instance; its dataset is built by make dataset-fire, its bundle by make wasm.

Where to get it #

The wrapper lives at pizza-wasm (MIT).

Companion tools #

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.

Calendar September 25, 2026
Edit Edit this page