[nodejs] deprecated created_index in favor of createIndex. (#145)

This commit is contained in:
gsilvestrin
2023-06-03 11:05:35 -07:00
committed by GitHub
parent 2418de0a3c
commit f37994b72a
2 changed files with 9 additions and 2 deletions

View File

@@ -168,9 +168,16 @@ export class Table<T = number[]> {
*
* @param indexParams The parameters of this Index, @see VectorIndexParams.
*/
async create_index (indexParams: VectorIndexParams): Promise<any> {
async createIndex (indexParams: VectorIndexParams): Promise<any> {
return tableCreateVectorIndex.call(this._tbl, indexParams)
}
/**
* @deprecated Use [Table.createIndex]
*/
async create_index (indexParams: VectorIndexParams): Promise<any> {
return await this.createIndex(indexParams)
}
}
interface IvfPQIndexConfig {

View File

@@ -153,7 +153,7 @@ describe('LanceDB client', function () {
const uri = await createTestDB(32, 300)
const con = await lancedb.connect(uri)
const table = await con.openTable('vectors')
await table.create_index({ type: 'ivf_pq', column: 'vector', num_partitions: 2, max_iters: 2 })
await table.createIndex({ type: 'ivf_pq', column: 'vector', num_partitions: 2, max_iters: 2 })
}).timeout(10_000) // Timeout is high partially because GH macos runner is pretty slow
})