Skip to content

[Feature]: Add Elasticsearch Store Support#729

Merged
wzh1994 merged 60 commits intoLazyAGI:mainfrom
chenhao0205:ch/add-ed-store
Sep 25, 2025
Merged

[Feature]: Add Elasticsearch Store Support#729
wzh1994 merged 60 commits intoLazyAGI:mainfrom
chenhao0205:ch/add-ed-store

Conversation

@chenhao0205
Copy link
Contributor

@chenhao0205 chenhao0205 commented Aug 28, 2025

📌 PR 内容 / PR Description

  • This pull request introduces Elasticsearch as a storage option for LazyLLM.
    Added a new Elasticsearch store implementation
    Encapsulates the functionality for interacting with Elasticsearch, including data indexing and querying in lazyllm/tools/rag/store/segment/elasticsearch_store.py.

  • Testing Enhancements:
    Added tests for the Elasticsearch store in tests/basic_tests/test_store.py.
    Introduced new class TestSegmentStore
    Integrate and validate the Elasticsearch and Opensearch storage within the existing test suite, also allow future extension.

  • Enhanced API documentation
    provide detailed guidance on using the new Elasticsearch storage feature, covering interface definitions, usage examples, and parameter explanations.

✅ 变更类型 / Type of Change

  • [√] 新功能 / New feature (non-breaking change that adds functionality)
  • [√] 文档更新 / Documentation update (changes to docs only)

⚡ 更新后的用法示例 / Usage After Update

>>> import lazyllm
>>> from lazyllm.tools.rag.store import ElasticSearchStore
>>> store = ElasticSearchStore(uris=["localhost:9200"], client_kwargs={}, index_kwargs={})
>>> store.connect(embed_dims={"vec_dense": 128, "vec_sparse": 128}, embed_datatypes={"vec_dense": DataType.FLOAT32, "vec_sparse": DataType.FLOAT32}, global_metadata_desc={})
>>> store.upsert(collection_name="test", data=[{"uid": "1", "embedding": {"vec_dense": [0.1, 0.2, 0.3], "vec_sparse": {"1": 0.1, "2": 0.2, "3": 0.3}}, "metadata": {"key1": "value1", "key2": "value2"}}])
>>> store.get(collection_name="test", criteria={"uid": "1"})
>>> store.delete(collection_name="test", criteria={"uid": "1"})

⚠️ 注意事项 / Additional Notes

requirements.full.txt: elasticsearch<7.17.12

@ChenJiahaoST ChenJiahaoST changed the title CH/Add Elasticsearch Store Support [Feature]: Add Elasticsearch Store Support Aug 28, 2025
@ChenJiahaoST ChenJiahaoST self-requested a review August 28, 2025 03:46
Copy link
Collaborator

@ChenJiahaoST ChenJiahaoST left a comment

Choose a reason for hiding this comment

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

  • 小修完补充下api文档

@mergify mergify bot added the lint_pass label Sep 19, 2025
@lwj-st lwj-st removed the lint_pass label Sep 23, 2025
lwj-st added a commit to LazyAGI/LazyLLM-Env that referenced this pull request Sep 23, 2025
lwj-st added a commit to LazyAGI/LazyLLM-Env that referenced this pull request Sep 23, 2025
@mergify mergify bot added the lint_pass label Sep 23, 2025
@lwj-st lwj-st removed the lint_pass label Sep 24, 2025
@mergify mergify bot added the lint_pass label Sep 24, 2025
@wzh1994 wzh1994 merged commit 958e2a2 into LazyAGI:main Sep 25, 2025
33 of 45 checks passed
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.

4 participants