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

Function insert_and_query

nodedb-fts/src/lsm/memtable.rs:223–234  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221
222 #[test]
223 fn insert_and_query() {
224 let mt = Memtable::new(MemtableConfig::default());
225 mt.insert("hello", make_posting(0, 1));
226 mt.insert("hello", make_posting(1, 2));
227 mt.insert("world", make_posting(0, 1));
228
229 assert_eq!(mt.get_postings("hello").len(), 2);
230 assert_eq!(mt.get_postings("world").len(), 1);
231 assert!(mt.get_postings("missing").is_empty());
232 assert_eq!(mt.term_count(), 2);
233 assert_eq!(mt.posting_count(), 3);
234 }
235
236 #[test]
237 fn remove_doc() {

Callers

nothing calls this directly

Calls 2

make_postingFunction · 0.70
insertMethod · 0.45

Tested by

no test coverage detected