Find answers from the community

Updated 3 months ago

Reset

How can I reset the values of docstore and index_store?

This approach isn't working:
Plain Text
# Create a new instance of SimpleDocumentStore to clear it --> DOES'T WORK
logger.info(f"Current docstore: {json.dumps(storage_context.docstore, indent=4, sort_keys=True, default=custom_serializer)}")
docstore = SimpleDocumentStore()
logger.info(f"New docstore: {json.dumps(storage_context.docstore, indent=4, sort_keys=True, default=custom_serializer)}")

# Create a new instance of SimpleIndexStore to clear it --> DOES'T WORK
logger.info(f"Current index_store: {json.dumps(storage_context.index_store, indent=4, sort_keys=True, default=custom_serializer)}")
index_store = SimpleIndexStore()
logger.info(f"New index_store: {json.dumps(storage_context.index_store, indent=4, sort_keys=True, default=custom_serializer)}")

# RESULT: The values of each are the same before and after resetting the instance
L
2 comments
I think you should just create a new index?
Not sure what the issue is here tbh πŸ˜…
Add a reply
Sign up and join the conversation on Discord