update configs after rebuild

This commit is contained in:
Ivan Pleshkov
2023-07-11 19:38:44 +00:00
parent 483cee7fe7
commit 365a6bc0b5
2 changed files with 8 additions and 3 deletions
+2
View File
@@ -186,6 +186,8 @@ impl Collection {
for shard in target_shards {
shard.rebuild_hnsw(m, ef).await?;
}
self.collection_config.read().await.save(&self.path)?;
Ok(())
}
+6 -3
View File
@@ -40,7 +40,7 @@ use crate::types::{
};
use crate::vector_storage::{new_raw_scorer, ScoredPointOffset, VectorStorage, VectorStorageEnum};
const HNSW_HEURISTIC_MODE: HeuristicMode = HeuristicMode::Nearest;
const HNSW_HEURISTIC_MODE: HeuristicMode = HeuristicMode::Combined;
const BYTES_IN_KB: usize = 1024;
pub struct HNSWIndex<TGraphLinks: GraphLinks> {
@@ -374,9 +374,12 @@ impl<TGraphLinks: GraphLinks> VectorIndex for HNSWIndex<TGraphLinks> {
self.config.m = m;
self.config.ef_construct = ef;
self.config.ef = ef;
self.save_config()?;
let stopped = Arc::new(AtomicBool::new(false));
self.build_index(&stopped)
self.build_index(&stopped)?;
self.save_config()?;
Ok(())
}
fn search(