mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-06 20:02:58 +00:00
Exposing limit parameter (#73)
This commit is contained in:
@@ -78,7 +78,7 @@ export class Table {
|
||||
* Create a search query to find the nearest neighbors of the given query vector.
|
||||
* @param queryVector The query vector.
|
||||
*/
|
||||
search(queryVector: number[]): Query {
|
||||
search (queryVector: number[]): Query {
|
||||
return new Query(this._tbl, queryVector)
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ export class Table {
|
||||
export class Query {
|
||||
private readonly _tbl: any
|
||||
private readonly _query_vector: number[]
|
||||
private readonly _limit: number
|
||||
private _limit: number
|
||||
private readonly _refine_factor?: number
|
||||
private readonly _nprobes: number
|
||||
private readonly _columns?: string[]
|
||||
@@ -106,6 +106,14 @@ export class Query {
|
||||
this._where = undefined
|
||||
}
|
||||
|
||||
set limit (value: number) {
|
||||
this._limit = value
|
||||
}
|
||||
|
||||
get limit (): number {
|
||||
return this._limit
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the query and return the results as an Array of Objects
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user