-
-
Notifications
You must be signed in to change notification settings - Fork 814
Closed
Description
The code on the indexing where we are creating vector embeddings can be optimized beacused I realized when you run the notebook more than once it creates a duplicate "indexing" which creates an error:
We can introduce a code line to delete the index if it exits
Like this :
Delete the index if it exists
es_client.indices.delete(index=index_name, ignore_unavailable=True)
# Create the new index
es_client.indices.create(index=index_name, body=index_settings)
print(f"Index '{index_name}' created successfully.")
Metadata
Metadata
Assignees
Labels
No labels