From 976edeb2ff3b936e864eaf02cb54553f00ad3242 Mon Sep 17 00:00:00 2001 From: Yang Cen Date: Wed, 17 Jun 2026 19:28:42 +0800 Subject: [PATCH] feat(query): add approx mode to vector queries (#3549) ## Feature ### What is the new feature? Adds Rust core API support for configuring vector query approximation mode with `ApproxMode::{Fast, Normal, Accurate}`. ### Why do we need this feature? Lance already exposes `lance_index::vector::ApproxMode` and scanner support for controlling the speed/accuracy tradeoff for approximate vector search. LanceDB Rust queries need to expose and pass this setting through for local/native and remote vector searches. ### How does it work? - Adds public `ApproxMode` in `rust/lancedb`, with lowercase serde, `Default::Normal`, parse/display, and conversions to/from Lance's `ApproxMode`. - Adds `approx_mode: Option` to `VectorQueryRequest` and a `VectorQuery::approx_mode(...)` builder. - Applies the mode to native/local Lance scanners after `nearest(...)` when explicitly set. - Sends `approx_mode` in remote query JSON only when explicitly set; default requests omit it. ## Validation - `cargo fmt --all` - `cargo test --quiet --features remote approx_mode` - `cargo test --quiet --features remote test_query_vector_default_values` - `cargo check --quiet --features remote --tests --examples` - `git diff --check`