From 0b74a28991b1ca003981fc58e062c762a74b882e Mon Sep 17 00:00:00 2001 From: Natasha Boyse Date: Mon, 17 Feb 2025 10:40:04 +0000 Subject: [PATCH] no 5 --- redbox-core/tests/test_ingest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/redbox-core/tests/test_ingest.py b/redbox-core/tests/test_ingest.py index 7ee221b8..297bb269 100644 --- a/redbox-core/tests/test_ingest.py +++ b/redbox-core/tests/test_ingest.py @@ -249,6 +249,10 @@ def test_ingest_from_loader( mapping = {"properties": {"embedding": {"type": "knn_vector", "dimension": 1024}}} + # Check if the index already exists and delete it if it does + if es_client.indices.exists(index="my_index"): + es_client.indices.delete(index="my_index") + es_client.indices.create(index="my_index", body={"mappings": mapping}) # Mock embeddings