Delete all vectors belonging to a multi-vector document.
(&mut self, document_surrogate: Surrogate)
| 50 | |
| 51 | /// Delete all vectors belonging to a multi-vector document. |
| 52 | pub fn delete_multi_vector(&mut self, document_surrogate: Surrogate) -> usize { |
| 53 | let Some(ids) = self.multi_doc_map.remove(&document_surrogate) else { |
| 54 | return 0; |
| 55 | }; |
| 56 | let mut deleted = 0; |
| 57 | for id in &ids { |
| 58 | if self.delete(*id) { |
| 59 | deleted += 1; |
| 60 | } |
| 61 | self.surrogate_map.remove(id); |
| 62 | } |
| 63 | self.surrogate_to_local.remove(&document_surrogate); |
| 64 | deleted |
| 65 | } |
| 66 | |
| 67 | /// Look up the surrogate for a global vector ID. |
| 68 | pub fn get_surrogate(&self, vector_id: u32) -> Option<Surrogate> { |