Skip to content

query: expose row id, fast search and RRF options - #135

Merged
Xuanwo merged 3 commits into
mainfrom
xuanwo/query-flags-rrf
Nov 22, 2026
Merged

Xuanwo merged 3 commits into
mainfrom
xuanwo/query-flags-rrf

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Adds the remaining Go-main query behavior from #127 and #131 that the pinned lancedb v0.42.0-beta.21 SDK supports, without taking over the broader options in #127 (owner: #8) or the rest of #131.

Refs #127
Refs #131

API

  • lancedb_query_with_row_id, lancedb_query_fast_search
    • Plain scans and standalone full-text searches.
  • lancedb_vector_query_with_row_id, lancedb_vector_query_fast_search, lancedb_vector_query_bypass_vector_index
    • Vector queries. On hybrid search, fast search is part of the shared request and applies to both legs; bypass only affects the vector leg.
  • LanceDBNormalizeMethod (Score, Rank)
  • lancedb_vector_query_rerank_rrf(query, k)
  • lancedb_vector_query_norm(query, method)
    • Only affect hybrid vector plus full-text queries. On a vector-only query the SDK stores the reranker but does not invoke it. RRF uses list positions, so normalization does not change its ranking or _relevance_score, but it does change the normalized _score preserved in the result.

Defaults and unset state are preserved: flags default off, no setter leaves the SDK default RRF k = 60, and k is forwarded unchanged after an explicit setter. Embedded LanceDB applies fast search after bypass, so fast search wins when both are set; a remote LanceDB forwards both flags to the server. Embedded hybrid EXPLAIN returns the SDK's unsupported-shape error; execution is supported. A rejected normalization value leaves any previous selection unchanged.

Out of scope: QueryExecutionOptions, dynamic projection, take, structured FTS ASTs, new vector types, order_by, and plain-query reranker/postfilter changes.

Verification

  • cargo fmt --check
  • check-abi self-test for host LP64 and x86_64-pc-windows-msvc after integrating current main: 155 extern functions, 27 structs and 6 enums match, including lancedb_version() and the new checked enum parameter.
  • Strict C17 syntax checks for the public header, the C enum helper and the C17 consumer.
  • C++ syntax checks for the modified Catch2 suites, including -Wall -Wextra -Werror.
  • New native tests assert actual returned keys and _rowid values for plain/vector fast search, ANN-node removal through EXPLAIN plus the flat nearest row for bypass, standalone FTS row ids and index-only filtering, exact custom/default RRF scores, exact differing normalized _score values for both normalization methods, and invalid setter arguments.
  • Runtime CTest is left to the existing native CI. It was not run locally to avoid starting a full Cargo build on the shared host.

Fixture added 3 commits November 22, 2026 06:39
Add with_row_id and fast_search to the plain and vector query builders, bypass_vector_index to the vector builder, and explicit RRF k plus normalization for hybrid search. These are the remaining Go-main query behaviors from #127 and #131 that the pinned 0.42.0-beta.21 SDK implements.

Plain scans and standalone full-text searches gain _rowid and index-only fast search. Vector queries also gain exhaustive index bypass. The RRF setter only affects hybrid vector plus full-text queries, and normalization is wired through the SDK while leaving RRF ranking unchanged because RRF consumes list positions rather than normalized scores.

Cover the actual returned keys and _rowid values for fast search and bypass, exact custom/default RRF scores, both normalization methods, and invalid setter arguments.
Assert that bypass removes the pinned scanner's ANN nodes while returning the flat nearest row, and that normalization changes the hybrid result's preserved _score with exact SDK-derived values. Remove duplicate RRF score checks and clarify hybrid fast-search scope, embedded fast-search priority, remote flag forwarding, hybrid EXPLAIN limits and rejected normalization selection.
@Xuanwo
Xuanwo merged commit 0d8439a into main Nov 22, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant