mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-08 21:56:32 +00:00
Know if your vectors are implicit when writing them back in documents + don't write empty _vectors
This commit is contained in:
@ -332,14 +332,22 @@ where
|
||||
}
|
||||
vectors.insert(
|
||||
name,
|
||||
serde_json::json!({
|
||||
"regenerate": entry.regenerate,
|
||||
// TODO: consider optimizing the shape of embedders here to store an array of f32 rather than a JSON object
|
||||
"embeddings": entry.embeddings,
|
||||
}),
|
||||
if entry.implicit {
|
||||
serde_json::json!(entry.embeddings)
|
||||
} else {
|
||||
serde_json::json!({
|
||||
"regenerate": entry.regenerate,
|
||||
// TODO: consider optimizing the shape of embedders here to store an array of f32 rather than a JSON object
|
||||
"embeddings": entry.embeddings,
|
||||
})
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if vectors.is_empty() {
|
||||
break 'inject_vectors;
|
||||
}
|
||||
|
||||
vectors_value = serde_json::value::to_raw_value(&vectors).unwrap();
|
||||
unordered_field_buffer.push((vectors_fid, &vectors_value));
|
||||
}
|
||||
|
Reference in New Issue
Block a user