Build the embedders when importing a dump

This commit is contained in:
Louis Dureuil 2024-02-26 22:15:57 +01:00
parent b005eb3289
commit 716ffc07ee
No known key found for this signature in database

View File

@ -426,6 +426,9 @@ fn import_dump(
let reader = BufReader::new(file); let reader = BufReader::new(file);
let reader = DocumentsBatchReader::from_reader(reader)?; let reader = DocumentsBatchReader::from_reader(reader)?;
let embedder_configs = index.embedding_configs(&wtxn)?;
let embedders = index_scheduler.embedders(embedder_configs)?;
let builder = milli::update::IndexDocuments::new( let builder = milli::update::IndexDocuments::new(
&mut wtxn, &mut wtxn,
&index, &index,
@ -438,6 +441,8 @@ fn import_dump(
|| false, || false,
)?; )?;
let builder = builder.with_embedders(embedders);
let (builder, user_result) = builder.add_documents(reader)?; let (builder, user_result) = builder.add_documents(reader)?;
let user_result = user_result?; let user_result = user_result?;
tracing::info!(documents_found = user_result, "{} documents found.", user_result); tracing::info!(documents_found = user_result, "{} documents found.", user_result);