MCPcopy Create free account
hub / github.com/cosdata/cosdata / load_inverted_index

Method load_inverted_index

src/models/collection_cache.rs:212–229  ·  view source on GitHub ↗

Loads the inverted index for a collection

(&self, name: &str)

Source from the content-addressed store, hash-verified

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> {

Callers 1

load_collectionMethod · 0.45

Calls 2

get_collectionMethod · 0.80
get_inverted_indexMethod · 0.80

Tested by

no test coverage detected