From 5ed04065caa74bb124ead268486b5ff8ed9d7220 Mon Sep 17 00:00:00 2001
From: Tomaz Bratanic <bratanic.tomaz@gmail.com>
Date: Sat, 17 Feb 2024 07:53:15 +0100
Subject: [PATCH] Fix Neo4jVector handling when multiple indexes are present in
 the db (#10749)

---
 .../llama_index/vector_stores/neo4jvector/base.py               | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llama-index-integrations/vector_stores/llama-index-vector-stores-neo4jvector/llama_index/vector_stores/neo4jvector/base.py b/llama-index-integrations/vector_stores/llama-index-vector-stores-neo4jvector/llama_index/vector_stores/neo4jvector/base.py
index d7b5708f59..9154902b2d 100644
--- a/llama-index-integrations/vector_stores/llama-index-vector-stores-neo4jvector/llama_index/vector_stores/neo4jvector/base.py
+++ b/llama-index-integrations/vector_stores/llama-index-vector-stores-neo4jvector/llama_index/vector_stores/neo4jvector/base.py
@@ -25,7 +25,7 @@ def sort_by_index_name(
     lst: List[Dict[str, Any]], index_name: str
 ) -> List[Dict[str, Any]]:
     """Sort first element to match the index_name if exists."""
-    return sorted(lst, key=lambda x: x.get("index_name") != index_name)
+    return sorted(lst, key=lambda x: x.get("name") != index_name)
 
 
 def clean_params(params: List[BaseNode]) -> List[Dict[str, Any]]:
-- 
GitLab