Loads the dense vector index for a collection
(&self, name: &str)
| 190 | |
| 191 | // Loads the dense vector index for a collection |
| 192 | fn load_dense_index(&self, name: &str) -> Result<Option<Arc<HNSWIndex>>, WaCustomError> { |
| 193 | info!("Loading dense index for collection: {}", name); |
| 194 | |
| 195 | // First check if the index exists in the AppEnv |
| 196 | if let Some(index) = self |
| 197 | .app_env |
| 198 | .collections_map |
| 199 | .get_collection(name) |
| 200 | .and_then(|collection| collection.get_hnsw_index()) |
| 201 | { |
| 202 | info!("Found HNSW index for '{}' in memory", name); |
| 203 | return Ok(Some(index)); |
| 204 | } |
| 205 | |
| 206 | // If not in memory, we would load it from disk |
| 207 | info!("No HNSW index found for '{}'", name); |
| 208 | Ok(None) |
| 209 | } |
| 210 | |
| 211 | // Loads the inverted index for a collection |
| 212 | fn load_inverted_index(&self, name: &str) -> Result<Option<Arc<InvertedIndex>>, WaCustomError> { |
no test coverage detected