summaryrefslogtreecommitdiff
path: root/storage/migrations/003_add_fts.up.sql
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-03-06 11:20:50 +0300
committerGrail Finder <wohilas@gmail.com>2026-03-06 11:20:50 +0300
commitf9866bcf5a7369e28246d51b951e81b5b2a8489f (patch)
treec09c3f4b0588a39735f19c61cf386195a1797604 /storage/migrations/003_add_fts.up.sql
parent822cc48834f5f1908f619b5441ae40946aceb86d (diff)
Feat (rag): hybrid search attempt
Diffstat (limited to 'storage/migrations/003_add_fts.up.sql')
-rw-r--r--storage/migrations/003_add_fts.up.sql15
1 files changed, 15 insertions, 0 deletions
diff --git a/storage/migrations/003_add_fts.up.sql b/storage/migrations/003_add_fts.up.sql
new file mode 100644
index 0000000..114586a
--- /dev/null
+++ b/storage/migrations/003_add_fts.up.sql
@@ -0,0 +1,15 @@
+-- Create FTS5 virtual table for full-text search
+CREATE VIRTUAL TABLE IF NOT EXISTS fts_embeddings USING fts5(
+ slug UNINDEXED,
+ raw_text,
+ filename UNINDEXED,
+ embedding_size UNINDEXED,
+ tokenize='porter unicode61' -- Use porter stemmer and unicode61 tokenizer
+);
+
+-- Create triggers to maintain FTS table when embeddings are inserted/deleted
+-- Note: We'll handle inserts/deletes programmatically for simplicity
+-- but triggers could be added here if needed.
+
+-- Indexes for performance (FTS5 manages its own indexes)
+-- No additional indexes needed for FTS5 virtual table. \ No newline at end of file