We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d1b4cd commit 5f1489bCopy full SHA for 5f1489b
src/VectorDatabase.php
@@ -188,7 +188,12 @@ public function deleteDocument(string|int $id): bool
188
$nodeId = $this->docIdToNodeId[$id];
189
190
// Soft-delete from HNSW (node stays for connectivity, excluded from results).
191
- $this->hnswIndex->delete($nodeId);
+ $deletedFromHnsw = $this->hnswIndex->delete($nodeId);
192
+ if ($deletedFromHnsw !== true) {
193
+ throw new \RuntimeException(
194
+ sprintf('Failed to delete node "%s" from HNSW index.', (string) $nodeId)
195
+ );
196
+ }
197
198
// Fully remove from BM25.
199
$this->bm25Index->removeDocument($nodeId);
0 commit comments