feat: full FTS BM25 integration — CREATE INDEX USING FTS, BM25 ranking on @@

- evalExpr accepts optional ExecutionContext for FTS index lookup
- CREATE INDEX ... USING FTS builds InvertedIndex from existing data
- @@ uses BM25 scoring when FTS index exists, falls back to term match
- INSERT/UPDATE/DELETE auto-maintain FTS indexes
- 283 tests, 0 failures
This commit is contained in:
2026-05-07 13:58:18 +03:00
parent b1aadf77f9
commit 32187099dd
4 changed files with 126 additions and 27 deletions
+6 -1
View File
@@ -776,8 +776,13 @@ proc parseCreateIndex(p: var Parser): Node =
while p.match(tkComma):
colNames.add(p.expect(tkIdent).value)
discard p.match(tkRParen)
var idxKind = ikBTree
if p.match(tkUsing):
let idxMethod = p.expect(tkIdent).value.toLower()
if idxMethod == "fts" or idxMethod == "fulltext":
idxKind = ikFullText
result = Node(kind: nkCreateIndex, ciName: idxName, ciTarget: tableName,
ciColumns: colNames, line: tok.line, col: tok.col)
ciColumns: colNames, ciKind: idxKind, line: tok.line, col: tok.col)
proc parseBeginTxn(p: var Parser): Node =
let tok = p.expect(tkBegin)