The community member is trying to move an in-memory index to a vector database without reprocessing the documents. They are reading the index using a storage context and trying to write it to an Elastic database, but it's not working. Another community member suggests a solution: get all the nodes from the in-memory index and add them to a new index that contains a third-party vector store.
How can I move my index created from documents which is stored in memory to vector database without reprocessing the document? I am reading the index using storage context and trying to write it to elastic database but it's not working.
# Get all the nodes from the in memory index
nodes = index.docstore.docs
# Now add the nodes in the new index which contains third party vector store.
new_index = VectorStoreIndex(nodes, storage_context=storage_context)