Loads the inverted index for a collection
(&self, name: &str)
| 210 | |
| 211 | // Loads the inverted index for a collection |
| 212 | fn load_inverted_index(&self, name: &str) -> Result<Option<Arc<InvertedIndex>>, WaCustomError> { |
| 213 | info!("Loading inverted index for collection: {}", name); |
| 214 | |
| 215 | // First check if the index exists in the AppEnv |
| 216 | if let Some(index) = self |
| 217 | .app_env |
| 218 | .collections_map |
| 219 | .get_collection(name) |
| 220 | .and_then(|collection| collection.get_inverted_index()) |
| 221 | { |
| 222 | info!("Found inverted index for '{}' in memory", name); |
| 223 | return Ok(Some(index)); |
| 224 | } |
| 225 | |
| 226 | // If not in memory, same logic as for dense index |
| 227 | info!("No inverted index found for '{}'", name); |
| 228 | Ok(None) |
| 229 | } |
| 230 | |
| 231 | // Gets a list of all currently loaded collections |
| 232 | pub fn get_loaded_collections(&self) -> Vec<String> { |
no test coverage detected