Add function chains support for search - #586
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: yhmo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@yhmo Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco. |
|
Tick the box to add this pull request to the merge queue (same as
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new “function chain” API surface to the C++ SDK and wires it into SearchRequest serialization, enabling server-side post-processing pipelines (e.g., map/sort/limit) to be attached to search requests.
Changes:
- Introduces new
milvus::FunctionChain*types (stage/ops/expressions) and a fluent builder API. - Extends
milvus::SearchRequestto carry function chains and enforces mutual exclusion with rerank inValidate(). - Serializes function chains into the RPC search request and adds unit tests for the builder/request behavior.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/ut/types/TestFunctionChain.cpp | Adds unit tests for the new function-chain builder types and SearchRequest integration/conflict validation. |
| src/include/milvus/types/FunctionChain.h | Introduces the public SDK types for function chains (stages, ops, expressions, args). |
| src/impl/types/FunctionChain.cpp | Implements the function-chain builder/types declared in the public header. |
| src/include/milvus/request/dql/SearchRequest.h | Adds function-chain API to SearchRequest and stores chains in the request object. |
| src/impl/request/dql/SearchRequest.cpp | Implements function-chain accessors/mutators and validates rerank vs. function-chains conflict. |
| src/impl/utils/TypeUtils.h | Declares ConvertFunctionChain() for proto serialization support. |
| src/impl/utils/TypeUtils.cpp | Implements function-chain proto serialization, including nested params/args encoding. |
| src/impl/MilvusClientV2Impl.cpp | Populates RPC function_chains on search requests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #586 +/- ##
===========================================
+ Coverage 53.47% 87.28% +33.80%
===========================================
Files 52 381 +329
Lines 4432 15991 +11559
Branches 0 1752 +1752
===========================================
+ Hits 2370 13957 +11587
+ Misses 2062 2034 -28
🚀 New features to boost your workflow:
|
8d33aee to
b124a01
Compare
|
@yhmo Thanks for your contribution. Please submit with DCO, see the contributing guide https://github.com/milvus-io/milvus/blob/master/CONTRIBUTING.md#developer-certificate-of-origin-dco. |
Signed-off-by: yhmo <yihua.mo@zilliz.com>
No description provided.