Skip to content

Commit 507994e

Browse files
committed
fix: Index.fts({ withPosition: true }) to enable phrase queries
Fix BM25 search failure: position is not found but required for phrase queries Root cause: Index.fts() accepts an options object, not a boolean. Index.fts(true) sets options=true, so options?.withPosition is undefined. Fix: use Index.fts({ withPosition: true }) instead. Fixes: #402
1 parent 6b2397c commit 507994e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ export class MemoryStore {
362362
// LanceDB @lancedb/lancedb >=0.26: use Index.fts() config
363363
const lancedb = await loadLanceDB();
364364
await table.createIndex("text", {
365-
config: (lancedb as any).Index.fts(),
365+
config: (lancedb as any).Index.fts({ withPosition: true }),
366366
});
367367
}
368368
} catch (err) {

0 commit comments

Comments
 (0)