Skip to content

Lesson 04-monitoring offline-rag-evaluation #93

@buriihenry

Description

@buriihenry

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions