feat: expose approx_mode on vector queries

`ApproxMode` landed in the Rust core in #3549, but the Python and Node.js bindings were never plumbed, so `approx_mode` is unreachable from either SDK. Both were built mirroring the existing `ef` plumbing.

Co-authored-by: Leo <leo@insight.co>
This commit is contained in:
Leo
2026-11-03 12:45:52 +08:00
committed by GitHub
co-authored by Leo
parent f9389f113e
commit f2bcb156ad
13 changed files with 326 additions and 12 deletions
+32
View File
@@ -101,6 +101,38 @@ AnalyzeExec verbose=true, metrics=[]
***
### approxMode()
```ts
approxMode(approxMode): VectorQuery
```
Set the speed / accuracy tradeoff to use for approximate search
This currently affects RQ-quantized indexes, such as IVF_RQ, and
prefiltered search on HNSW indexes, where "fast" enables the ACORN
traversal. Other index types ignore this setting.
"fast" favors lower latency and may reduce recall, "normal" (the default)
uses the index's default balance, and "accurate" favors higher recall and
may increase latency.
#### Parameters
* **approxMode**: `"fast"` \| `"normal"` \| `"accurate"`
#### Returns
[`VectorQuery`](VectorQuery.md)
#### Example
```ts
table.vectorSearch([0.1, 0.2]).approxMode("fast").limit(10);
```
***
### bypassVectorIndex()
```ts