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
vector_id = sum([index.ntotal for index in self.faiss_indexes.values()])
> vector_id_map = {}
> for doc in document_batch:
> vector_id_map[str(doc.id)] = str(vector_id) + "_" + index
> vector_id += 1
> self.update_vector_ids(vector_id_map, index=index)
当删除数据之后再增加数据时,vector_id会重复,导致SQL更新冲突:
(sqlite3.IntegrityError) UNIQUE constraint failed: document.vector_id
[SQL: UPDATE document SET vector_id=CASE document.id WHEN ? THEN ? WHEN ? THEN ? WHEN ? THEN ? END WHERE document.id IN (?, ?, ?) AND document."index" = ?]
[parameters: ('a11c96f3f9729487bb584f52e404a5a', '275_faiss_index', 'cd10279366bb16cd8a48696b179bdd3', '276_faiss_index', 'd81e0d6d84af695310371c6d915e2293', '277_faiss_index', 'a11c96f3f9729487bb584f52e404a5a', 'cd10279366bb16cd8a48696b179bdd3', 'd81e0d6d84af695310371c6d915e2293', 'faiss_index')]
(Background on this error at: https://sqlalche.me/e/14/gkpj)
The text was updated successfully, but these errors were encountered:
软件环境
重复问题
错误描述
稳定复现步骤 & 代码
update_embeddings新增数据的时候,vector_id以当前文档个数依次增加:
当删除数据之后再增加数据时,vector_id会重复,导致SQL更新冲突:
The text was updated successfully, but these errors were encountered: