fix: limit and offset support paginating through FTS and vector search results (#2592)

Adds tests to ensure that users can paginate through simple scan, FTS,
and vector search results using `limit` and `offset`.

Tests upstream work: https://github.com/lancedb/lance/pull/4318

Closes #2459
This commit is contained in:
Will Jones
2025-08-15 08:55:12 -07:00
committed by GitHub
parent 941eada703
commit dcf53c4506
3 changed files with 129 additions and 15 deletions

View File

@@ -563,7 +563,7 @@ describe("When creating an index", () => {
// test offset
rst = await tbl.query().limit(2).offset(1).nearestTo(queryVec).toArrow();
expect(rst.numRows).toBe(1);
expect(rst.numRows).toBe(2);
// test nprobes
rst = await tbl.query().nearestTo(queryVec).limit(2).nprobes(50).toArrow();
@@ -702,7 +702,7 @@ describe("When creating an index", () => {
// test offset
rst = await tbl.query().limit(2).offset(1).nearestTo(queryVec).toArrow();
expect(rst.numRows).toBe(1);
expect(rst.numRows).toBe(2);
// test ef
rst = await tbl.query().limit(2).nearestTo(queryVec).ef(100).toArrow();