Skip to content

Conversation

@kaijchen
Copy link
Contributor

@kaijchen kaijchen commented Jan 5, 2026

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(es9): 实现 Elasticsearch 9 indexer 和 retriever 组件

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

en:
This PR implements the Indexer and Retriever components for Elasticsearch 9.x (ES9), enabling integration with the latest Elasticsearch version.

Key changes:

  1. Indexer (components/indexer/es9):

    • Implemented core Indexer logic and adapted for go-elasticsearch/v9.
    • Supports batch indexing and custom field mapping.
    • Full documentation (README) and examples included.
    • Verified with github.com/elastic/go-elasticsearch/v9.
  2. Retriever (components/retriever/es9):

    • Implemented Retriever interface with support for multiple search modes:
      • Approximate (KNN, Hybrid, RRF)
      • Dense Vector Similarity (Script Score)
      • Exact Match
      • Raw String (DSL)
      • Sparse Vector Query
    • Updated API usage to match ES9 client changes (e.g., ScriptScore.Query type change, Similarity enum).
    • Comprehensive tests and examples.
  3. Verification:

    • All unit tests passed.
    • Verified against a local Elasticsearch 9 Docker instance with TLS enabled.
    • Verified backward compatibility of design references (consistent with ES7/ES8 patterns).

zh:
此 PR 实现了 Elasticsearch 9.x (ES9) 的 Indexer 和 Retriever 组件,支持与最新版本的 Elasticsearch 集成。

主要变更:

  1. Indexer (components/indexer/es9):

    • 适配了 go-elasticsearch/v9 客户端。
    • 支持批量索引和自定义字段映射。
    • 包含完整的文档和示例代码。
  2. Retriever (components/retriever/es9):

    • 实现了 Retriever 接口,支持多种搜索模式:
      • 近似搜索 (KNN, 混合搜索, RRF)
      • 稠密向量相似度 (Script Score)
      • 精确匹配
      • 原始字符串查询 (DSL)
      • 稀疏向量查询
    • 适配了 ES9 客户端的 API 变更(如 ScriptScore.Query 类型和 Similarity 枚举)。
    • 包含完整的测试和示例。
  3. 验证:

    • 所有单元测试通过。
    • 在开启 TLS 的本地 Elasticsearch 9 环境中验证了所有示例。

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

(optional) The PR that updates user documentation:

Copy link
Contributor

@N3kox N3kox left a comment

Choose a reason for hiding this comment

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

lgtm

@N3kox N3kox merged commit 1fc701c into cloudwego:main Jan 14, 2026
5 checks passed
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