Skip to content

Add function chains support for search - #586

Merged
sre-ci-robot merged 1 commit into
milvus-io:masterfrom
yhmo:mm
Aug 26, 2026
Merged

Add function chains support for search#586
sre-ci-robot merged 1 commit into
milvus-io:masterfrom
yhmo:mm

Conversation

@yhmo

@yhmo yhmo commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI lite review requested due to automatic review settings August 24, 2026 10:10
@sre-ci-robot

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify

mergify Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

@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.

@mergify

mergify Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::SearchRequest to carry function chains and enforces mutual exclusion with rerank in Validate().
  • 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.

Comment thread src/include/milvus/types/FunctionChain.h
Comment thread src/impl/utils/TypeUtils.cpp
Comment thread src/impl/utils/TypeUtils.cpp Outdated
Comment thread src/impl/request/dql/SearchRequest.cpp
Comment thread src/impl/request/dql/SearchRequest.cpp
Comment thread src/include/milvus/request/dql/SearchRequest.h
Comment thread src/include/milvus/request/dql/SearchRequest.h
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.71795% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.28%. Comparing base (a0592aa) to head (f4a1b8c).
⚠️ Report is 150 commits behind head on master.

Files with missing lines Patch % Lines
src/impl/types/FunctionChain.cpp 91.11% 8 Missing ⚠️
src/impl/utils/TypeUtils.cpp 86.66% 8 Missing ⚠️
src/impl/MilvusClientV2Impl.cpp 25.00% 3 Missing ⚠️
src/impl/request/dql/SearchRequest.cpp 92.50% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             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     
Files with missing lines Coverage Δ
src/include/milvus/request/dql/SearchRequest.h 100.00% <ø> (ø)
src/include/milvus/types/FunctionChain.h 100.00% <100.00%> (ø)
src/impl/MilvusClientV2Impl.cpp 80.04% <25.00%> (ø)
src/impl/request/dql/SearchRequest.cpp 92.98% <92.50%> (ø)
src/impl/types/FunctionChain.cpp 91.11% <91.11%> (ø)
src/impl/utils/TypeUtils.cpp 89.78% <86.66%> (ø)

... and 392 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yhmo
yhmo force-pushed the mm branch 5 times, most recently from 8d33aee to b124a01 Compare August 25, 2026 13:35
Comment thread src/impl/utils/TypeUtils.cpp Outdated
Comment thread src/impl/types/FunctionChain.cpp
Comment thread test/e2e/ClientTelemetryE2E.cpp
Comment thread test/ut/utils/TestTypeUtils.cpp
@mergify

mergify Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

@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.

Comment thread src/impl/request/dql/SearchRequest.cpp
Signed-off-by: yhmo <yihua.mo@zilliz.com>
@mergify mergify Bot added the ci-passed label Aug 26, 2026
@yhmo yhmo added the lgtm label Aug 26, 2026
@sre-ci-robot
sre-ci-robot merged commit 60576dd into milvus-io:master Aug 26, 2026
12 checks passed
@yhmo
yhmo deleted the mm branch August 27, 2026 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants