File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ def update_KNN_graph(self):
128128 index = self .graph .query ("""show indexes yield * where type = 'VECTOR' and name = 'vector'""" )
129129 # logging.info(f'show index vector: {index}')
130130 knn_min_score = os .environ .get ('KNN_MIN_SCORE' )
131- if index [ 0 ][ 'name' ] == 'vector' :
131+ if len ( index ) > 0 :
132132 logging .info ('update KNN graph' )
133133 result = self .graph .query ("""MATCH (c:Chunk)
134134 WHERE c.embedding IS NOT NULL AND count { (c)-[:SIMILAR]-() } < 5
@@ -138,6 +138,8 @@ def update_KNN_graph(self):
138138 {"score" :float (knn_min_score )}
139139 )
140140 logging .info (f"result : { result } " )
141+ else :
142+ logging .info ("Vector index does not exist, So KNN graph not update" )
141143
142144 def connection_check (self ):
143145 """
You can’t perform that action at this time.
0 commit comments