Tutorial

Lesson 1 — First search

/ Tutorial, / Getting-Started

Lesson 1 — First search #

Start the node, index documents, run your first queries, and watch them update in real time.

The use case #

Your application produces a stream of documents — logs, events, messages — and they are only useful if they are searchable the moment they land: no nightly batch, no refresh call, no second system to keep in sync. The questions this lesson answers:

...

Lesson 2 — Text search

/ Tutorial, / Text

Lesson 2 — Text search #

How text actually matches: analysis, exact terms, phrases, and the error-tolerant family. Everything below runs live on the logs collection (150 documents with message, level, host, url.path).

The use case #

The search box in front of users — application logs, product descriptions, support tickets. Users type in one casing, with typos, and your data is cased differently; the craft is choosing the right amount of looseness per question:

...

Lesson 3 — Structure and numbers

/ Tutorial, / Sort, / Range

Lesson 3 — Structure and numbers #

Ranges, sorts, and cursor pagination over the sales collection (120 documents: type, price, qty, amount, merchant, status, date).

The use case #

Most queries are not about words — they are filters and ordering over the structured half of the document: prices, quantities, timestamps. And real interfaces page through result sets, sometimes deeply. The questions this lesson answers:

  • “Sales priced $45 to $60” / “everything from 2024” — range over a typed field.
  • “Top 5 by amount” — the canonical sort clause.
  • “Page 3000 of a big result set, without re-ranking the world” — cursor pagination (search_after), where from+size breaks down.
  • “Why did my filter miss the row with 45?” — the field-type system: 45 the number and "45" the keyword are different values.

The types behind the data #

Numbers are indexed as their real types (float for price, integers for qty), dates as epoch millis. That is what makes the queries below precise — see the field types reference for the full catalog.

...

Lesson 4 — Aggregations

/ Tutorial, / Aggregation

Lesson 4 — Aggregations #

From counts to histograms to composite paging — over sales and logs, with known answers you can verify by hand.

The use case #

Dashboards, reports, and faceted navigation — wherever the deliverable is not a page of hits but an answer. The questions this lesson answers:

  • “What is the average / min / max price?” — metric aggregations.
  • “How is revenue split by status?” — terms buckets.
  • “Volume per week / per price band” — histograms.
  • “Every (merchant, day) pair, complete — not just the top N” — composite aggregations with after cursors.
  • “Just the number, skip the hits” — size: 0.

Metric aggregations #

One number out: sum, avg, min, max, stats (all of them at once), cardinality (distinct values):

...

Lesson 5 — Graph traversal

/ Tutorial, / Graph

Lesson 5 — Graph traversal #

Relations are the first of the two features that most distinguish Pizza from a plain text index: edges as a first-class query target. This lesson walks edges inside one collection — the traversal sections run live in the browser widget, and the modeling section at the end is curl against a live node.

Graph queries are also the one lesson without a SQL pairing: traverse stays DSL-side — it is demand-gated outside the SQL M1 subset, which stops at the single-collection statement.

...

Lesson 6 — Hybrid search

/ Tutorial, / Hybrid, / Vector

Lesson 6 — Hybrid search #

Most engines hide their fusion behind a magic flag. Pizza exposes the retrieval pipeline as explicit request stages — retrieve runs retrievers in parallel, fuse merges them, and two more stages re-shape scores afterwards:

retrieve  →  fuse  →  score_functions  →  rescore
(parallel    (merge    (function           (second pass
 retrievers)  the lists) scoring)            on the top window)

Every stage is optional and combines with a plain query — you can use score_functions alone on a keyword search, or the full chain for hybrid retrieval.

...

Lesson 7 — Geographic search

/ Tutorial, / Geo

Lesson 7 — Geographic search #

From schema to data to queries: filter documents by where they are — a coordinate, a rectangle, an arbitrary polygon, or a full geometric shape.

Pizza has two geographic field types, and picking the right one is the whole design step:

  • geo_point — a single coordinate. Answers “where is this document?” Distance, box and polygon filters run against it.
  • geo_shape — a full geometry: point, line, polygon, multi-variant, envelope or geometry collection. Answers “what area does this document cover?” and supports the relation vocabulary (intersects, within, contains, disjoint).

A store is a geo_point; the district it serves is a geo_shape.

...

Lesson 8 — Joins

/ Tutorial, / Join, / Relational

Lesson 8 — Joins #

Traversal (Lesson 5) walks edges inside ONE collection. A join spans TWO: it answers questions a single collection cannot — orders whose customer is gold-tier, where the tier lives in a different collection.

Joins need a running node (the gateway orchestrates the two sides, which is why the wasm playground does not host them), so this lesson is curl against your Lesson 1 node — no live widget. Like traverse, join stays DSL-side outside the SQL M1 subset.

...

Lesson 9 — Operations

/ Tutorial, / Operations

Lesson 9 — Operations #

Keeping a node healthy: partial updates in place, compaction, the change feed, and reading cluster state. This lesson is server-side — start a node as in Lesson 1 and run the curls against it.

The use case #

The features that matter once the node serves real traffic: mutating documents without rewriting them, keeping storage healthy, reacting to every write, and reading cluster state. The questions this lesson answers:

...