Find answers from the community

Updated 3 months ago

trying to delete indexed document, and I

trying to delete indexed document, and I am not sure why this does not work :
doc = Document(text="yo it is me") doc.id_ = "MY_GREAT_ID" nodes = HierarchicalNodeParser.from_defaults(chunk_sizes=[2048, 512, 128]).get_nodes_from_documents([doc]) docstore.add_documents(nodes) # this fails with "ValueError: doc_id MY_GREAT_ID not found." docstore.delete_document("MY_GREAT_ID")
L
A
3 comments
docstore.delete_ref_doc("MY_GREAT_ID")
Your document is broken into nodes, each with their own ID, need to delete by ref doc
@Logan M you are the true hero of this discord πŸ™
Add a reply
Sign up and join the conversation on Discord