----------------------
To delete documents from the vector store index, you can use the
delete
method provided by the vector store instance. The
delete
method requires the document ID as an argument. Here is an example of how you can use it:
document_id = documents[0].doc_id
vector_store.delete(document_id)
After deleting, you can check the number of documents remaining in the index. For example, if you are using Redis as your vector store, you can do it like this:
redis_client = vector_store.client
print("Number of documents", len(redis_client.keys()))
If you want to delete the entire index, you can use the
delete_index
method:
vector_store.delete_index()
Please note that the
delete_ref_doc
method you mentioned is not found in the provided extracts. It's possible that you might be using a different method or there might be a typo in your code.
Sources:
- RedisIndexDemo.ipynb ()
- TairIndexDemo.ipynb ()
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------