Skip to main content

Module document

Module document 

Source
Expand description

The data model: documents, WAL operations, and the per-namespace schema.

Structs§

Document
One stored item: an id, a vector, and optional free-form JSON.
Schema
The shape every document in a namespace must have.

Enums§

Metric
How distance between two vectors is measured.
WalOp
One mutation recorded in the write-ahead log.

Constants§

MAX_ID_BYTES
The most bytes an id may be: a document’s id on upsert, or an id passed to delete. An id is a free-form string with no other structure (a UUID, a natural key, whatever the caller already has), but it is stored in every WAL object and segment that touches it, so an unbounded one lets a single write blow up an object’s size. 512 bytes covers any realistic key (a UUID is 36) with room to spare.
MAX_SPARSE_TERMS
The most terms one document’s sparse vector may hold. The term count is a u16 in the WAL object and in sparse.bin, and a longer vector is refused by upsert with ItzmaError::InvalidVector before anything is written.

Type Aliases§

SparseVector
A sparse vector: term id and weight pairs, in the style SPLADE and similar learned-sparse models produce. Itzma assigns no meaning to a term id — it is the caller’s own vocabulary (a tokenizer’s ids, typically) — and keeps no string dictionary. See Namespace::query_sparse.