Skip to main content

insert_document_with_chunks_and_ids

Function insert_document_with_chunks_and_ids 

Source
pub fn insert_document_with_chunks_and_ids(
    conn: &Connection,
    doc_id: &str,
    title: &str,
    namespace: &str,
    source_path: Option<&str>,
    metadata: Option<&Value>,
    chunks: &[ChunkRow],
    chunk_ids: &[String],
) -> Result<(), MemoryError>
Expand description

Insert a document and all its chunks + FTS entries in a single transaction, using pre-generated chunk IDs (for HNSW key mapping).

chunks is a vec of (content, embedding_bytes, q8_bytes, token_count_estimate). chunk_ids must have the same length as chunks.