diff --git a/chromadb/segment/impl/vector/local_persistent_hnsw.py b/chromadb/segment/impl/vector/local_persistent_hnsw.py index a0b52acd07a..6e1df7b1f1f 100644 --- a/chromadb/segment/impl/vector/local_persistent_hnsw.py +++ b/chromadb/segment/impl/vector/local_persistent_hnsw.py @@ -225,11 +225,13 @@ def _write_records(self, records: Sequence[EmbeddingRecord]) -> None: exists_in_index = self._id_to_label.get( id, None ) is not None or self._brute_force_index.has_id(id) + exists_in_bf_index = self._brute_force_index.has_id(id) if op == Operation.DELETE: if exists_in_index: self._curr_batch.apply(record) - self._brute_force_index.delete([record]) + if exists_in_bf_index: + self._brute_force_index.delete([record]) else: logger.warning(f"Delete of nonexisting embedding ID: {id}")