💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Rewrite reindex SQL function, closes #190
davidmezzetti4efe59e3081a
diff --git a/src/python/txtai/database/sqlite.py b/src/python/txtai/database/sqlite.pyindex dda50b92..86aafddf 100644--- a/src/python/txtai/database/sqlite.py+++ b/src/python/txtai/database/sqlite.py@@ -79,8 +79,8 @@ class SQLite(Database):INSERT_SECTION = "INSERT INTO sections VALUES (?, ?, ?, ?, ?)"DELETE_SECTIONS = "DELETE FROM sections WHERE id IN (SELECT id FROM batch)"COPY_SECTIONS = (- "INSERT INTO %s SELECT indexid-1, id, text, tags, entry FROM (SELECT row_number() OVER (ORDER BY indexid) AS indexid, "- + "s.id, %s AS text, s.tags, s.entry FROM sections s LEFT JOIN documents d ON s.id = d.id)"+ "INSERT INTO %s SELECT (select count(*) - 1 from sections s1 where s.indexid >= s1.indexid) indexid, "+ + "s.id, %s AS text, s.tags, s.entry FROM sections s LEFT JOIN documents d ON s.id = d.id ORDER BY indexid")STREAM_SECTIONS = "SELECT s.id, s.text, object, s.tags FROM %s s LEFT JOIN objects o ON s.id = o.id ORDER BY indexid"DROP_SECTIONS = "DROP TABLE sections"