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

Method remove_internal

nodedb/src/engine/vector/sparse/index.rs:100–111  ·  view source on GitHub ↗

Remove all posting entries for an internal doc ID.

(&mut self, internal_id: u32)

Source from the content-addressed store, hash-verified

98
99 /// Remove all posting entries for an internal doc ID.
100 fn remove_internal(&mut self, internal_id: u32) {
101 if let Some(dims) = self.doc_dims.remove(&internal_id) {
102 for dim in dims {
103 if let Some(list) = self.postings.get_mut(&dim) {
104 list.retain(|&(id, _)| id != internal_id);
105 if list.is_empty() {
106 self.postings.remove(&dim);
107 }
108 }
109 }
110 }
111 }
112
113 /// Get the posting list for a dimension.
114 pub fn get_postings(&self, dim: u32) -> Option<&[(u32, f32)]> {

Callers 2

insertMethod · 0.80
deleteMethod · 0.80

Calls 3

removeMethod · 0.45
get_mutMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected