diff --git a/node/src/index.ts b/node/src/index.ts index cd7d0d40..7489b049 100644 --- a/node/src/index.ts +++ b/node/src/index.ts @@ -168,9 +168,16 @@ export class Table { * * @param indexParams The parameters of this Index, @see VectorIndexParams. */ - async create_index (indexParams: VectorIndexParams): Promise { + async createIndex (indexParams: VectorIndexParams): Promise { return tableCreateVectorIndex.call(this._tbl, indexParams) } + + /** + * @deprecated Use [Table.createIndex] + */ + async create_index (indexParams: VectorIndexParams): Promise { + return await this.createIndex(indexParams) + } } interface IvfPQIndexConfig { diff --git a/node/src/test/test.ts b/node/src/test/test.ts index 5988be6a..87d881be 100644 --- a/node/src/test/test.ts +++ b/node/src/test/test.ts @@ -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 })