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

Method execute_sparse_delete

nodedb/src/data/executor/handlers/vector_sparse.rs:159–180  ·  view source on GitHub ↗

Delete a document from the sparse inverted index.

(
        &mut self,
        task: &ExecutionTask,
        tid: u64,
        collection: &str,
        field_name: &str,
        doc_id: &str,
    )

Source from the content-addressed store, hash-verified

157
158 /// Delete a document from the sparse inverted index.
159 pub(in crate::data::executor) fn execute_sparse_delete(
160 &mut self,
161 task: &ExecutionTask,
162 tid: u64,
163 collection: &str,
164 field_name: &str,
165 doc_id: &str,
166 ) -> Response {
167 debug!(core = self.core_id, %collection, %field_name, %doc_id, "sparse delete");
168
169 let key = Self::sparse_index_key(tid, collection, field_name);
170 let Some(index) = self.sparse_vector_indexes.get_mut(&key) else {
171 return self.response_error(task, ErrorCode::NotFound);
172 };
173
174 if index.delete(doc_id) {
175 self.checkpoint_coordinator.mark_dirty("vector", 1);
176 self.response_ok(task)
177 } else {
178 self.response_error(task, ErrorCode::NotFound)
179 }
180 }
181}

Callers 1

dispatch_vectorMethod · 0.80

Calls 5

response_errorMethod · 0.80
mark_dirtyMethod · 0.80
response_okMethod · 0.80
get_mutMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected