7
7
NEURAL_SEARCH = os .getenv ("NEURAL_SEARCH" )
8
8
9
9
10
+ def neural_search_1_12_0 () -> bool :
11
+ __neural_search_1_12_0_update_qdrant ()
12
+ return True
13
+
14
+
15
+ def __neural_search_1_12_0_update_qdrant () -> bool :
16
+ print ("upgrade qdrant version, recreate collections" , flush = True )
17
+ success = True
18
+
19
+ # only recreate collections, no need to create missing collections
20
+ embedding_items = embedding .get_finished_attribute_embeddings ()
21
+
22
+ url_recreate = f"{ NEURAL_SEARCH } /recreate_collection"
23
+ for project_id , embedding_id in embedding_items :
24
+ params = {
25
+ "project_id" : str (project_id ),
26
+ "embedding_id" : str (embedding_id ),
27
+ }
28
+ response = requests .post (url = url_recreate , params = params )
29
+
30
+ if response .status_code != 200 :
31
+ print (response .content )
32
+ success = False
33
+
34
+ if success :
35
+ print ("Recreated all collections." , flush = True )
36
+ else :
37
+ print ("Recreating collections failed." , flush = True )
38
+ return success
39
+
40
+
10
41
def neural_search_1_2_1 () -> bool :
11
42
print ("upgrade qdrant version, recreate collections" , flush = True )
12
43
success = __recreate_qdrant_collections ()
@@ -18,7 +49,6 @@ def neural_search_1_2_1() -> bool:
18
49
19
50
20
51
def __recreate_qdrant_collections () -> bool :
21
-
22
52
success = True
23
53
24
54
# recreate collections
0 commit comments