Find answers from the community

Updated 3 months ago

Index

Hi, is there a way to merge two pre defined indexes into one new index?
W
L
M
3 comments
You can get the nodes from both the indexes and create a new index.

new_nodes = index1.docstore.docs + index2.docstore.docs

index3 = VectorStoreIndex(new_nodes)
I think docstore.docs returns a dict, but the idea is the same πŸ™‚

new_nodes = index1.docstore.docs.values() + index2.docstore.docs.values()
Add a reply
Sign up and join the conversation on Discord