mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-08 21:02:58 +00:00
feat: expose hnsw indices (#1595)
PR closes #1522 --------- Co-authored-by: Will Jones <willjones127@gmail.com>
This commit is contained in:
@@ -444,6 +444,26 @@ describe("When creating an index", () => {
|
||||
expect(fs.readdirSync(indexDir)).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("create a hnswPq index", async () => {
|
||||
await tbl.createIndex("vec", {
|
||||
config: Index.hnswPq({
|
||||
numPartitions: 10,
|
||||
}),
|
||||
});
|
||||
const indexDir = path.join(tmpDir.name, "test.lance", "_indices");
|
||||
expect(fs.readdirSync(indexDir)).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("create a HnswSq index", async () => {
|
||||
await tbl.createIndex("vec", {
|
||||
config: Index.hnswSq({
|
||||
numPartitions: 10,
|
||||
}),
|
||||
});
|
||||
const indexDir = path.join(tmpDir.name, "test.lance", "_indices");
|
||||
expect(fs.readdirSync(indexDir)).toHaveLength(1);
|
||||
});
|
||||
|
||||
test("create a label list index", async () => {
|
||||
await tbl.createIndex("tags", {
|
||||
config: Index.labelList(),
|
||||
|
||||
Reference in New Issue
Block a user