Exposing limit parameter (#73)

This commit is contained in:
gsilvestrin
2023-05-11 09:12:06 -07:00
committed by GitHub
parent 5bb5b0a685
commit 648f8123ca
4 changed files with 22 additions and 6 deletions

View File

@@ -66,6 +66,15 @@ describe('LanceDB client', function () {
assert.approximately(results[0].vector[0], 3.1, 0.1)
assert.approximately(results[0].vector[1], 4.1, 0.1)
})
it('limits # of results', async function () {
const table = await tablePromise
const builder = table.search([0.1, 0.3])
builder.limit = 1
const results = await builder.execute() as MyResult[]
assert.equal(results.length, 1)
})
})
})
})