I tried something like this:
pinecone_index.delete(
filter={
"file_id": {"$eq": file_id},
}
)
# Get document from file path
docs = SimpleDirectoryReader(input_files=[file_path]).load_data()
# customize document doc_id and metadata
logging.info("Adding doc_id to documents")
for i in range(len(docs)):
# Add azure path to documents
docs[i].doc_id = f"{file_id}_part_{i}"
# Add azure path to metadata
docs[i].metadata["azure_path"] = azure_paths[x]
docs[i].metadata["file_id"] = file_id
# Exclude azure path from embedding
docs[i].excluded_embed_metadata_keys = ["azure_path", "file_id"]
documents.extend(docs)
but the vectors aren't being deleted. Does
metadata
get passed up to the pinecone vectors?