refreshing documents in index generated form text nodes #12650
Replies: 3 comments
-
Based on your description, it seems like you're trying to refresh an index that was created from nodes, but the nodes don't have document IDs. This is causing an issue because the Here's a step-by-step guide on how you can resolve this issue:
Here's a simplified example of how you might prepare and call # Assuming `documents` is a list of Document objects with unique IDs
updated_documents = [...] # Your updated documents with IDs
# Create or update the index with updated documents
refreshed_docs_flags = index.refresh_ref_docs(updated_documents)
# `refreshed_docs_flags` will be a list of booleans indicating which documents were refreshed Remember, the key to using For more details, you can refer to the source code of the Sources
|
Beta Was this translation helpful? Give feedback.
-
I have run into the same issue, do we have any answer on the above question? |
Beta Was this translation helpful? Give feedback.
-
I have this issue as well. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm still trying to understand how to refresh the underlying documents in an Index if the index was created by nodes and not directly from documents. In my application I first manually create a list of documents. I then want to further split the content of these documents into nodes using something like SentenceWindowNodeParser or SimpleNodeParser. I hand over the documents to those parsers using the get_nodes_from_documents(). I then create an index from the results of the NodeParsers. In this situation what can I do if only some documents change or are added? If I try to apply the refresh_ref_docs() function to my index (generated from nodes) I get the error that text nodes don't have document IDs.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions