Skip to content

Conversation

@kaijchen
Copy link
Contributor

What type of PR is this?

feat

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

feat(milvus2): 新增 milvus2 indexer 和 retriever 组件

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
This PR introduces new Milvus 2.x components (indexer and retriever) using the latest milvus-io/milvus/client/v2 SDK.

Indexer Features:

  • Auto collection management: automatically creates collections and indexes when needed
  • Multiple index builders: Auto, HNSW, IVF_FLAT, IVF_PQ, IVF_SQ8, IVF_RabitQ (Milvus 2.6+), FLAT, DiskANN, SCANN
  • Custom document-to-column conversion support
  • Dynamic schema support

Retriever Features:

  • Multiple search modes: Approximate, Range, Hybrid, Iterator, and Scalar search
  • Score threshold filtering
  • Grouping support
  • Custom result-to-document conversion

Examples included:

  • Indexer: demo, hnsw, ivf_flat, rabitq, auto, diskann
  • Retriever: approximate, range, hybrid, iterator, scalar, grouping, filtered

zh:
本 PR 引入了基于最新 milvus-io/milvus/client/v2 SDK 的 Milvus 2.x 组件(indexer 和 retriever)。

Indexer 特性:

  • 自动集合管理:按需自动创建集合和索引
  • 多种索引构建器:Auto、HNSW、IVF_FLAT、IVF_PQ、IVF_SQ8、IVF_RabitQ(Milvus 2.6+)、FLAT、DiskANN、SCANN
  • 支持自定义文档到列的转换
  • 支持动态 Schema

Retriever 特性:

  • 多种搜索模式:Approximate、Range、Hybrid、Iterator 和 Scalar 搜索
  • 分数阈值过滤
  • 分组支持
  • 支持自定义结果到文档的转换

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@kaijchen kaijchen force-pushed the milvus2 branch 4 times, most recently from 99df3b2 to 6f069fc Compare December 26, 2025 08:04
@hi-pender hi-pender self-requested a review December 26, 2025 12:47
@@ -1,3 +1,5 @@
// Deprecated: use github.com/cloudwego/eino-ext/components/indexer/milvus2 instead.
// This module uses milvus-sdk-go v2.4.x which only supports Milvus 2.4.
Copy link
Contributor

Choose a reason for hiding this comment

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

milvus v2.6 sdk 能够访问 Milvus 2.4 么, 同样处在 v2 版本中,一般情况下,应该是兼容升级的。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我试过基本用法是可以的,不确定是否有 corner case。
官方推荐对应版本用对应的 sdk。
2.4 肯定不支持 2.6 的新功能(比如 RaBitQ index)。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

要不我改一下吧,2.4及以下用老的 milvus,2.5及以上用新的 milvus2。
刚好 2.5 开始支持 bm25 function,sparse 向量检索的接口可以简化。

Copy link
Contributor

Choose a reason for hiding this comment

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

不用改哈,如果官方推荐 SDK 和 Server 的版本对应, 咱们就按照官方的建议来

Copy link
Contributor

@hi-pender hi-pender Jan 5, 2026

Choose a reason for hiding this comment

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

我看你都改完了,抱歉,回复晚了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我们给每个小版本搞一个 EINO component 不太现实,这里就选了最新的 2.6 SDK。
我后面改的是稀疏向量检索的接口,用 milvus 2.5 内置的 function 实现应该更好。
原来那个 EINO milvus 模块要 deprecated 吗?统一用这个新的?

Copy link
Contributor

Choose a reason for hiding this comment

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

从语义化版本号的角度看,v2.4 升级 到 v2.6 应该是兼容的(这里的兼容主要是指 v2.6的 SDK 应该兼容访问 v2.4 的 server)。 在 v2 的大版本,我觉得 milvus 自身要应当做到高版本SDK能够兼容访问低版本 Server。
我自己没有亲自用过,关于 milvus 版本管理,也没有啥经验。 从直觉上看,在 v2 大版本内,应该直接升级。

然后我确实也见到一个关于不兼容的反馈:

  1. v2.4 升级时,有些字段或结构体等 export 实体,出现了不兼容变化。 这种情况有可能被 eino milvus 的封装屏蔽掉了,即使屏蔽不掉,出现简单易对应的不兼容修改,我觉得也能接受

Copy link
Contributor

Choose a reason for hiding this comment

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

另外看到 milvus sdk,从 v2.6 才开始打 tag, 原来都是直接使用主分支

Copy link
Contributor

Choose a reason for hiding this comment

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

不知道你这边是否了解更多关于 高版本 SDK 和 低版本 Server 之间的有关兼容性的案例,可以分享出来让我们参考下

Copy link
Contributor Author

Choose a reason for hiding this comment

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

按照 semantic version 确实应该兼容,测试过一些基础的功能是兼容的。但不确定是否有 corner case。

官方的文档是从 2.5 开始切换到 milvus client 的,2.4 及以前是用的 milvus-go-sdk
https://milvus.io/api-reference/go/v2.6.x/About.md
文档里的兼容性列表 SDK 版本推荐使用和 Server 版本对应的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants