Skip to content

Commit 601d2da

Browse files
Droped the old vector index (#652)
1 parent dbb87f7 commit 601d2da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

backend/src/make_relationships.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ def update_embedding_create_vector_index(graph, chunkId_chunkDoc_list, file_name
6666
# }
6767
# )
6868
# logging.info('create vector index on chunk embedding')
69+
result = graph.query("SHOW INDEXES YIELD * WHERE labelsOrTypes = ['Chunk'] and name = 'vector'")
70+
if result:
71+
logging.info(f"vector index dropped for 'Chunk'")
72+
graph.query("DROP INDEX vector IF EXISTS;")
6973

7074
graph.query("""CREATE VECTOR INDEX `vector` if not exists for (c:__Chunk__) on (c.embedding)
7175
OPTIONS {indexConfig: {

0 commit comments

Comments
 (0)