branch: externals/elisa
commit f43953b4d7bba2a784d906896a2da48f9de24fbb
Author: Sergey Kostyaev <[email protected]>
Commit: Sergey Kostyaev <[email protected]>
Remove empty rows before recalculating embeddings
Clean up the database by removing rows with empty data before
recalculating and saving new embeddings. This ensures that only valid
data is processed.
---
elisa.el | 1 +
1 file changed, 1 insertion(+)
diff --git a/elisa.el b/elisa.el
index ed1aad8df3..415f7455fa 100644
--- a/elisa.el
+++ b/elisa.el
@@ -1505,6 +1505,7 @@ Find similar quotes in COLLECTIONS and add it to context."
(defun elisa-recalculate-embeddings ()
"Recalculate and save new embeddings after embedding provider change."
+ (sqlite-execute elisa-db "DELETE FROM data WHERE data = '';") ;; remove rows
without data
(let* ((data-rows (sqlite-select elisa-db "SELECT rowid, data FROM data;"))
(texts (mapcar #'cadr data-rows))
(rowids (mapcar #'car data-rows))