Find answers from the community

Updated 9 months ago

Hey guys i have a question. Is possible

Hey guys i have a question. Is possible to use the nodes in the docstore.json and rebiuld a vector/index store? Because i want to modify some metadata keywords manually to do some tests, but i dont find how to create the new vector store with this modified docstore.json
W
1 comment
Yes you can.
Plain Text
# Take out all the nodes from the active index
nodes = index.docstore.docs

# Iterate over the nodes to add metadata or update text.
for node in nodes:
   node.metadata["new_key"] = "new_value"

# Now add the updated node to a new index
new_index = VectorStoreIndex(nodes,...)
Add a reply
Sign up and join the conversation on Discord