diff --git a/redisvl/exceptions.py b/redisvl/exceptions.py index 15b29bf2..6f811dd6 100644 --- a/redisvl/exceptions.py +++ b/redisvl/exceptions.py @@ -87,6 +87,10 @@ def for_svs_vamana(cls, min_redis_version: str): "no such index", "search_index_not_found", "index not found", + # Valkey Search words the error as + # "Index with name '' not found in database ", where the index + # name sits between "index" and "not found", so "index not found" misses it. + "not found in database", ) diff --git a/tests/unit/test_index_exists.py b/tests/unit/test_index_exists.py index 25469ab3..b64ff0cf 100644 --- a/tests/unit/test_index_exists.py +++ b/tests/unit/test_index_exists.py @@ -34,6 +34,10 @@ f"{INDEX_NAME}: no such index", f"SEARCH_INDEX_NOT_FOUND Index not found: {INDEX_NAME}", "Index not found", + # Valkey Search (e.g. Amazon ElastiCache for Valkey) puts the index name + # between "index" and "not found", so the "index not found" fragment above + # does not match it. Before #672 this wording worked via FT._LIST. + f"Index with name '{INDEX_NAME}' not found in database 0", ] # Failures that must never be read as "the index is absent": reporting False