Lesson 04-monitoring offline-rag-evaluation
Opened this issue · 0 comments
buriihenry commented
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.")