fix updating documents without updating the settings

This commit is contained in:
Tamo 2024-09-19 11:41:55 +02:00
parent e8d7c00d30
commit 633537ccd7
3 changed files with 46 additions and 19 deletions

View file

@ -705,7 +705,11 @@ where
InternalError::DatabaseMissingEntry { db_name: "embedder_category_id", key: None },
)?;
let embedder_config = settings_diff.embedding_config_updates.get(&embedder_name);
let was_quantized = embedder_config.map_or(false, |action| action.was_quantized);
let was_quantized = settings_diff
.old
.embedding_configs
.get(&embedder_name)
.map_or(false, |conf| conf.2);
let is_quantizing = embedder_config.map_or(false, |action| action.is_being_quantized);
pool.install(|| {

View file

@ -668,9 +668,10 @@ pub(crate) fn write_typed_chunk_into_index(
InternalError::DatabaseMissingEntry { db_name: "embedder_category_id", key: None },
)?;
let binary_quantized = settings_diff
.embedding_config_updates
.old
.embedding_configs
.get(&embedder_name)
.map_or(false, |conf| conf.was_quantized);
.map_or(false, |conf| conf.2);
// FIXME: allow customizing distance
let writers: Vec<_> = crate::vector::arroy_db_range_for_embedder(embedder_index)
.map(|k| ArroyWrapper::new(index.vector_arroy, k, binary_quantized))