MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / delete_across_segments

Function delete_across_segments

nodedb-vector/src/collection/search.rs:540–550  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

538
539 #[test]
540 fn delete_across_segments() {
541 let mut coll = VectorCollection::new(2, HnswParams::default());
542 for i in 0..10 {
543 coll.insert(vec![i as f32, 0.0]);
544 }
545 assert!(coll.delete(5));
546 assert_eq!(coll.live_count(), 9);
547
548 let results = coll.search(&[5.0, 0.0], 10, 64);
549 assert!(results.iter().all(|r| r.id != 5));
550 }
551
552 /// Build a sealed HNSW segment from `n` vectors of `dim=2`, where vector `i`
553 /// is `[i as f32, 0.0]`. Returns the collection with one sealed segment.

Callers

nothing calls this directly

Calls 2

insertMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected