Find answers from the community

Updated 2 months ago

Deleting document ids from a persisting duckdb index

Anyway to delete(https://docs.llamaindex.ai/en/stable/module_guides/indexing/document_management/) document() IDs from a persisting DuckDB index?
W
J
6 comments
I am using vector_store.delete(documents[0].doc_id) to delete a document loaded in current session. i don't know the doc_IDs of documents in a persisting database. I guess correct question is, how to know doc_IDs of documents in a persisting DuckDB database file so that I can delete them.
From where did you get this documents object? I'm guessing you just created them just now?
Are they added in the vector store?

You can do simple query and the response contains retrieved nodes which contains node ID then you can try deleting them.

both ways should work:
  • vector_store.delete('doc_id_HERE')
  • index.delete_ref_doc(doc_id, delete_from_docstore=True)
From where did you get this documents object? I don't have doc object as I am loading a existing vector store from a persisted directory. That's where i am stuck at. How to get doc_ID for a document that i want to delete from a persisted DuckDB vector store.
You can do simple query and the response contains retrieved nodes which contains node ID then you can try deleting them. how to get doc_IDs from retrieved node objects? Ain't i need doc_IDs to delete?
once you retrieve the nodes, they contain the doc IDs in them
Add a reply
Sign up and join the conversation on Discord