use crate::schema::EntityKind; /// Declaration of a text field for full-text search indexing. /// /// Each `TextFieldDef` maps a metadata key (e.g., "title", "description") to /// a Tantivy indexing mode. Declared in the schema via `SchemaBuilder::text_field`. #[derive(Debug, Clone)] pub struct TextFieldDef { /// The metadata key to index (e.g., "title", "description", "tags"). pub key: String, /// Whether this field is tokenized (full-text) or raw (keyword/exact-match). pub field_type: TextFieldType, } /// The Tantivy indexing mode for a text field. #[derive(Debug, Clone, PartialEq, Eq)] pub enum TextFieldType { /// Full tokenization with Tantivy's default tokenizer. /// Good for: title, description, body text. Text, /// Raw storage, no tokenization. Only exact-match queries work. /// Good for: category, format, `creator_id`, language tags. Keyword, } /// Definition of an embedding vector slot for ANN search. /// /// Declared in the schema to tell tidalDB which embedding dimensions /// to expect for a given entity kind. The database retrieves and ranks /// over vectors -- it does not generate them. #[derive(Debug, Clone)] pub struct EmbeddingSlotDef { /// Slot name (e.g., "default", "thumbnail"). pub name: String, /// Which entity kind this slot is attached to. pub entity_kind: EntityKind, /// Dimensionality of the embedding vector. pub dimensions: usize, }