// SPDX-License-Identifier: BUSL-1.1
//! Redb table definitions for the full-text search backend.
//!
//! Every table is keyed by a structural `(tenant_id, collection, …)` tuple —
//! matching the EdgeStore pattern. Per-tenant drops become range scans
//! `(tid, ..)..(tid+1, ..)` instead of fragile lexical-prefix scans.
use TableDefinition;
/// Inverted index: key = `(tenant_id, collection, term)`,
/// value = MessagePack-encoded `Vec<Posting>`.
pub const POSTINGS: =
new;
/// Document lengths: key = `(tenant_id, collection, surrogate)`,
/// value = MessagePack-encoded `u32` token count.
/// The surrogate is stored as its raw `u32` value (redb native key type).
pub const DOC_LENGTHS: =
new;
/// Index metadata blobs: key = `(tenant_id, collection, sub_key)`,
/// value = opaque blob. Sub-keys: `"docmap"`, `"fieldnorms"`, `"analyzer"`,
/// `"language"`.
pub const INDEX_META: = new;
/// Corpus stats: key = `(tenant_id, collection)`,
/// value = MessagePack-encoded `(doc_count, total_token_sum)`.
pub const STATS: = new;
/// Segment blobs: key = `(tenant_id, collection, segment_id)`,
/// value = compressed segment bytes. `segment_id` format `"L{level}:{id:016x}"`.
pub const SEGMENTS: =
new;