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

Function empty_query

nodedb/src/engine/vector/sparse/search.rs:158–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

156
157 #[test]
158 fn empty_query() {
159 let mut idx = SparseInvertedIndex::new();
160 idx.insert("doc1", &make_sv(&[(10, 0.5)]));
161 let query = SparseVector::empty();
162 let results = dot_product_topk(&idx, &query, 10);
163 assert!(results.is_empty());
164 }
165
166 #[test]
167 fn no_overlap() {

Callers

nothing calls this directly

Calls 4

dot_product_topkFunction · 0.85
make_svFunction · 0.70
emptyFunction · 0.50
insertMethod · 0.45

Tested by

no test coverage detected