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

Function remove_document

nodedb/src/engine/sparse/inverted/tests.rs:86–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84
85#[test]
86fn remove_document() {
87 let (idx, _dir) = open_temp();
88 idx.index_document(T, "docs", Surrogate::new(1), "hello world")
89 .unwrap();
90 idx.index_document(T, "docs", Surrogate::new(2), "hello rust")
91 .unwrap();
92
93 idx.remove_document(T, "docs", Surrogate::new(1)).unwrap();
94
95 let results = idx.search(T, "docs", "hello", 10, false, None).unwrap();
96 assert_eq!(results.len(), 1);
97 assert_eq!(results[0].doc_id, Surrogate::new(2));
98}
99
100#[test]
101fn empty_query() {

Callers

nothing calls this directly

Calls 4

open_tempFunction · 0.70
index_documentMethod · 0.45
remove_documentMethod · 0.45
searchMethod · 0.45

Tested by

no test coverage detected