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

Method get_collection

src/models/types.rs:1358–1360  ·  view source on GitHub ↗

Returns the `Collection` by collection's name If not found, None is returned Note that it tried to look up the Collections in the DashMap only and doesn't check LMDB. This is because of the assumption that at startup, all collections will be loaded from LMDB into the in-memory DashMap and when a new collection is added, it will be written to the DashMap as well. @TODO: As a future improvement,

(&self, name: &str)

Source from the content-addressed store, hash-verified

1356 /// the Collection exists in LMDB and caching it. But it's not
1357 /// required for the current use case.
1358 pub fn get_collection(&self, name: &str) -> Option<Arc<Collection>> {
1359 self.inner_collections.get(name).map(|index| index.clone())
1360 }
1361
1362 pub fn remove_hnsw_index(&self, name: &str) -> Result<Option<Arc<HNSWIndex>>, WaCustomError> {
1363 match self.inner_collections.get(name) {

Callers 15

query_vectorsFunction · 0.80
get_vector_by_idFunction · 0.80
check_vector_existenceFunction · 0.80
create_collectionFunction · 0.80
get_collection_by_nameFunction · 0.80
dense_searchFunction · 0.80
batch_dense_searchFunction · 0.80
sparse_searchFunction · 0.80
batch_sparse_searchFunction · 0.80
hybrid_searchFunction · 0.80
batch_hybrid_searchFunction · 0.80

Calls 2

cloneMethod · 0.80
getMethod · 0.45

Tested by 5

mainFunction · 0.64
delete_collectionFunction · 0.64
mainFunction · 0.64
ensure_collectionFunction · 0.64