feat: migrate multi-vector query and reranker logic to C++#405
Merged
Conversation
zhourrr
reviewed
May 14, 2026
zhourrr
reviewed
May 15, 2026
zhourrr
reviewed
May 15, 2026
zhourrr
reviewed
May 15, 2026
zhourrr
reviewed
May 15, 2026
zhourrr
reviewed
May 15, 2026
zhourrr
reviewed
May 15, 2026
zhourrr
reviewed
May 15, 2026
zhourrr
reviewed
May 15, 2026
zhourrr
reviewed
May 19, 2026
zhourrr
reviewed
May 19, 2026
9f92f1b to
3d46458
Compare
zhourrr
reviewed
May 25, 2026
egolearner
reviewed
May 26, 2026
egolearner
reviewed
May 26, 2026
- Add Reranker base class with RrfReRanker and WeightedReRanker implementations - Add Collection::MultiQuery interface for multi-vector queries with reranking - Add MultiVectorQuery struct in doc.h with forward declaration for Reranker - Add C API bindings for reranker and MultiQuery (zvec_reranker_*, zvec_multi_vector_query_*, zvec_collection_multi_query) - Add Python binding for reranker classes with py::function bridge for callback - Validate duplicate field names in multi-vector queries (C++ and Python consistent) - Remove TODO comment about concurrent execution (SQLEngine is not thread-safe) - Update collection.h MultiQuery doc comment from concurrently to sequentially - Add C++ collection tests (6 MultiQuery test cases) - Add C API tests (reranker functions + multi_vector_query end-to-end) - Implement Python test cases (11 previously skipped tests now active) - Simplify Python query_executor validation for unified duplicate field check
…idate_and_sanitize)
…ction._get_object
- Register _SubVectorQuery in pybind11 with from_vector_query() factory - Convert _VectorQuery to _SubVectorQuery in MultiVectorQueryExecutor - Relax RRF/Weighted score assertion tolerance from 1e-10 to 1e-6 - Fix WeightedReRanker test metric to IP (matching HnswIndexParam default)
- import Callable from collections.abc instead of typing (UP035) - remove redundant quotes around MetricType annotations (UP037)
1871946 to
b4c0cb3
Compare
zhourrr
reviewed
May 28, 2026
zhourrr
reviewed
May 28, 2026
egolearner
reviewed
May 28, 2026
egolearner
reviewed
May 28, 2026
Cuiyus
reviewed
May 28, 2026
Cuiyus
reviewed
May 28, 2026
Cuiyus
reviewed
May 28, 2026
c838e3a to
b187572
Compare
egolearner
reviewed
May 28, 2026
egolearner
reviewed
May 28, 2026
…directly, and use insert return value to avoid duplicate set lookup
egolearner
reviewed
May 28, 2026
egolearner
reviewed
May 28, 2026
egolearner
reviewed
May 28, 2026
egolearner
reviewed
May 28, 2026
egolearner
reviewed
May 28, 2026
egolearner
reviewed
May 28, 2026
…PI callback reranker
egolearner
added a commit
to egolearner/zvec
that referenced
this pull request
May 29, 2026
Adapt FTS to the query-model refactor from alibaba#428/alibaba#405 on main: - VectorQuery is replaced by SearchQuery + QueryTarget (variant<VectorClause, FtsClause>) - Fold FTS validation into SearchQuery::validate_and_sanitize - c_api / python binding read & write FTS via FtsClause and target_.clause_ - Add QueryTarget::get_fts_clause() helper, replacing raw std::get_if calls - Migrate FTS tests to the new model; drop the vector/fts mutual-exclusion case that no longer applies under the variant
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refact: