Skip to content

feat: add hybrid search function chains and ListCompactionTasks - #611

Closed
yhmo wants to merge 2 commits into
milvus-io:masterfrom
yhmo:mm-hybrid-compaction
Closed

yhmo wants to merge 2 commits into
milvus-io:masterfrom
yhmo:mm-hybrid-compaction

Conversation

@yhmo

@yhmo yhmo commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

Fixes two gaps from the C++-vs-PyMilvus parity audit (gaps #1 and #2):

1. hybrid_search function_chains input (Partial)

  • HybridSearchRequest gains FunctionChains() / SetFunctionChains /
    WithFunctionChains / AddFunctionChain.
  • Validate() now accepts either a rerank function or function chains
    (rejects combining them), mirroring SearchRequest.
  • The hybrid-search pre-callback converts each chain into the proto
    function_chains member (which already existed in the pinned proto),
    matching pymilvus hybrid_search(function_chains=...).

2. list_compaction_tasks (Missing API)

  • New ListCompactionTasksRequest (db + collection name).
  • New MilvusClientV2::ListCompactionTasks facade that lists all retained
    compaction tasks of a collection via the GetCompactionStateWithPlans RPC
    (same request/response shape as GetCompactionPlans but keyed by
    collection_name), matching pymilvus list_compaction_tasks.
  • Bumped the pinned milvus-proto commit to ae7fea6, which adds
    db_name/collection_name/collection_id to GetCompactionPlansRequest
    (and, as a bonus, states to GetPersistentSegmentInfoRequest).

Supporting changes

  • DqlUtils::ConvertHybridSearchRequest: guard the rerank param mapping for a
    null rerank (function-chains path).
  • Unit tests for the new request members and hybrid validation; a mocked test
    asserting collection_name on the ListCompactionTasks wire request.

Verified: testing-ut (928) and testing-it (337) pass; clang-format/cpplint clean.

Signed-off-by: yhmo yihua.mo@zilliz.com

…quest DTOs

- deprecate AddCollectionFunctionRequest and DropCollectionFunctionRequest in
  favor of AddFunctionFieldRequest/DropFunctionFieldRequest (pymilvus parity)
- add examples/src/v2 alias.cpp, partition.cpp and index.cpp demonstrating the
  alias, partition and index management APIs
- general.cpp: demonstrate delete-by-ids, delete-by-filter, truncate and rename
- add_field.cpp: demonstrate AlterCollectionFieldProperties on an added field
- db.cpp: demonstrate AlterDatabaseProperties and DropDatabaseProperties

Signed-off-by: yhmo <yihua.mo@zilliz.com>
Copilot AI lite review requested due to automatic review settings September 24, 2026 10:48
@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

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mergify

mergify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@codecov

codecov Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.66667% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.67%. Comparing base (a0592aa) to head (839babd).
⚠️ Report is 166 commits behind head on master.

Files with missing lines Patch % Lines
src/impl/request/dql/HybridSearchRequest.cpp 66.66% 12 Missing ⚠️
src/impl/MilvusClientV2Impl.cpp 80.76% 10 Missing ⚠️
src/impl/utils/DqlUtils.cpp 80.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master     #611       +/-   ##
===========================================
+ Coverage   53.47%   89.67%   +36.20%     
===========================================
  Files          52      393      +341     
  Lines        4432    16852    +12420     
  Branches        0     1856     +1856     
===========================================
+ Hits         2370    15112    +12742     
+ Misses       2062     1740      -322     
Files with missing lines Coverage Δ
src/impl/MilvusClientV2Impl.h 100.00% <ø> (ø)
src/impl/MilvusConnection.cpp 89.34% <100.00%> (+29.18%) ⬆️
src/impl/MilvusConnection.h 82.14% <ø> (-14.53%) ⬇️
...mpl/request/utility/ListCompactionTasksRequest.cpp 100.00% <100.00%> (ø)
...pl/response/utility/GetCompactionPlansResponse.cpp 100.00% <100.00%> (ø)
src/impl/types/CompactionPlan.cpp 100.00% <100.00%> (ø)
src/include/milvus/MilvusClientV2.h 33.33% <ø> (ø)
.../request/collection/AddCollectionFunctionRequest.h 100.00% <ø> (ø)
...request/collection/DropCollectionFunctionRequest.h 100.00% <ø> (ø)
...c/include/milvus/request/dql/HybridSearchRequest.h 100.00% <ø> (ø)
... and 5 more

... and 395 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-hybrid-compaction branch from f3bb6bf to 407c1c7 Compare September 28, 2026 08:22
- HybridSearchRequest: add FunctionChains()/SetFunctionChains/
  WithFunctionChains()/AddFunctionChain(); Validate() rejects function chains
  combined with a rerank and requires either one; the pre-callback converts
  each chain into the proto (pymilvus hybrid_search function_chains parity)
- ListCompactionTasks: new ListCompactionTasksRequest + MilvusClientV2::
  ListCompactionTasks facade that lists all retained compaction tasks of a
  collection via GetCompactionStateWithPlans (pymilvus list_compaction_tasks)
- bump pinned milvus-proto to ae7fea6 so GetCompactionPlansRequest carries
  db_name/collection_name (also adds GetPersistentSegmentInfoRequest.states)
- DqlUtils: guard the rerank param mapping for a null rerank function
- CompactionPlan: expose the full CompactionMergeInfo surface (plan_id,
  trigger_id, collection_id, partition_id, channel, type, state,
  failure_reason, targets) and CompactionType/CompactionTaskState enums;
  GetCompactionPlansResponse gains CollectionName() (pymilvus Plan parity)
- add unit tests for the new request members/validation and a mocked test
  asserting collection_name and the full plan fields on the wire response
- test: switch system-test MinIO image to milvusdb/minio:RELEASE.2024-05-28T17-19-04Z

Signed-off-by: yhmo <yihua.mo@zilliz.com>
@yhmo
yhmo force-pushed the mm-hybrid-compaction branch from 407c1c7 to 839babd Compare September 28, 2026 09:31
@mergify mergify Bot added the ci-passed label Sep 28, 2026
@yhmo yhmo closed this Sep 28, 2026
@yhmo
yhmo deleted the mm-hybrid-compaction branch September 28, 2026 11:22
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