Skip to content

Commit 8e9395c

Browse files
authored
fix: Use the indexed metadata field 'ref_doc_id' instead of 'doc_id' during deletion. (#19759)
1 parent 8b8a1dc commit 8e9395c

File tree

1 file changed

+2
-2
lines changed
  • llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/llama_index/vector_stores/postgres

1 file changed

+2
-2
lines changed

llama-index-integrations/vector_stores/llama-index-vector-stores-postgres/llama_index/vector_stores/postgres/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ def delete(self, ref_doc_id: str, **delete_kwargs: Any) -> None:
10701070
self._initialize()
10711071
with self._session() as session, session.begin():
10721072
stmt = delete(self._table_class).where(
1073-
self._table_class.metadata_["doc_id"].astext == ref_doc_id
1073+
self._table_class.metadata_["ref_doc_id"].astext == ref_doc_id
10741074
)
10751075

10761076
session.execute(stmt)
@@ -1082,7 +1082,7 @@ async def adelete(self, ref_doc_id: str, **delete_kwargs: Any) -> None:
10821082
self._initialize()
10831083
async with self._async_session() as session, session.begin():
10841084
stmt = delete(self._table_class).where(
1085-
self._table_class.metadata_["doc_id"].astext == ref_doc_id
1085+
self._table_class.metadata_["ref_doc_id"].astext == ref_doc_id
10861086
)
10871087

10881088
await session.execute(stmt)

0 commit comments

Comments
 (0)