You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sql=f"""CREATE INDEX "embedding_hnsw_idx_{k_id}" ON embedding USING hnsw ((embedding::vector({dims})) vector_cosine_ops) WHERE knowledge_id = '{k_id}'"""
260
-
update_execute(sql, [])
261
-
maxkb_logger.info(f'Created index for knowledge ID: {k_id}')
259
+
# 超过2000维度不创建索引,pgvector hnsw索引不支持超过2000维度
260
+
ifdims<2000:
261
+
sql=f"""CREATE INDEX "embedding_hnsw_idx_{k_id}" ON embedding USING hnsw ((embedding::vector({dims})) vector_cosine_ops) WHERE knowledge_id = '{k_id}'"""
262
+
update_execute(sql, [])
263
+
maxkb_logger.info(f'Created index for knowledge ID: {k_id}')
0 commit comments