mirror of
https://github.com/lancedb/lancedb.git
synced 2026-11-26 20:44:00 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user