Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Use view of index instead of loading in memory

laurenspriemd85121862d0d
diff --git a/mobile/apps/photos/rust/src/api/usearch_api.rs b/mobile/apps/photos/rust/src/api/usearch_api.rs
index 49e8301375..847e86d665 100644
--- a/mobile/apps/photos/rust/src/api/usearch_api.rs
+++ b/mobile/apps/photos/rust/src/api/usearch_api.rs
@@ -32,7 +32,8 @@ impl VectorDB {
if file_exists {
println!("Loading index from disk.");
- db.index.load(file_path).expect("Failed to load index");
+ // Creates a view of the index from a file without loading it into memory. https://docs.rs/usearch/latest/usearch/struct.Index.html#method.view
+ db.index.view(file_path).expect("Failed to load index");
} else {
println!("Creating new index.");
db.save_index();