[Open Source] Elegantly Operate the Milvus Vector Database Using the Enhancement-Only Approach of MyBatisPlus

Open SourceClassification Systems
2026-06-28 09:00 4 次浏览 • 0 次下载 0KB
[Open Source] Elegantly Operate the Milvus Vector Database Using the Enhancement-Only Approach of MyBatisPlus

1. Project Overview

Dromara MilvusPlus: Enhanced Operations Library for Vector Databases

MilvusPlus (abbreviated as MP) is a Milvus utility designed to simplify interactions with the Milvus vector database. It provides developers with an intuitive API featuring annotation and method-calling styles similar to MyBatis-Plus, improving development efficiency.

2. Open Source License

Licensed under Apache-2.0

3. Screenshots

Image

4. Feature Overview

Features

  • non-intrusive
    : Enhances without changing existing functionality. Introducing it will not affect existing projects, ensuring seamless integration.
  • Low Overhead
    : Automatically injects basic CRUD operations at startup, with virtually no performance overhead, enabling direct object-oriented operations.
  • Powerful CRUD Operations
    : The general-purpose MilvusMapper enables CRUD operations with minimal configuration. It also provides a powerful condition builder to meet various usage requirements.
  • Intuitive API
    : A straightforward API design simplifies database operations, while MilvusService provides a rich set of APIs.
  • Supports Lambda Expressions
    : Easily write various query conditions using Lambda expressions without worrying about field name typos.
  • Supports Automatic Primary Key Generation
    : Completely solves primary key management issues.
  • Supports Custom Global Common Operations
    : Supports global injection of common methods.
  • Annotation-Based Configuration
    : Uses annotations similar to MyBatis-Plus to configure entity models.
  • Easy to Extend
    : The core design emphasizes extensibility.
  • Type Safety
    : Uses Java type safety to reduce errors.

Use Cases

  • Similarity Search
    : Quickly retrieves items most similar to a given vector.
  • Recommendation Systems
    : Recommends relevant content based on user behavior and preferences.
  • Image Retrieval
    : Finds the images most similar to a query image in a large-scale image database.
  • Natural Language Processing
    : Converts text into vectors and performs semantic searches.
  • Bioinformatics
    : Analyzes and compares biological sequences, such as proteins and genomic data.

Custom Annotation Details

Automating Milvus database integration using custom annotations provides the following significant advantages:

  • Simplified Development Workflow
    : Database structures can be declared directly in code through annotations, eliminating the need to manually create collections, fields, indexes, and partitions. Everything is automatically generated when the project starts, reducing the need to manually write Milvus API calls.
  • Improved Development Efficiency
    : The annotation-driven approach makes creating and managing database structures faster and more convenient, accelerating development.
  • Enhanced Code Readability
    : Closely integrates database structure definitions with business logic code, improving code readability and maintainability.
  • Reduced Errors
    : Automated database structure creation reduces the possibility of human errors and improves system stability.
  • Easy to maintain
    : Using annotations makes database structure changes more centralized and explicit, simplifying subsequent maintenance and upgrades.

5. Tech Stack

Use MyBatisPlus-style operations to elegantly interact with the Milvus vector database, with support for both Spring and Solon.

Quick Start

Custom Extension Support:

<dependency>
    <groupId>org.dromara.milvus-plus</groupId>
    <artifactId>milvus-plus-core</artifactId>
    <version>2.2.4</version>
</dependency>

Spring Application Support:

<dependency>
    <groupId>org.dromara.milvus-plus</groupId>
    <artifactId>milvus-plus-boot-starter</artifactId>
    <version>2.2.4</version>
</dependency>

Solon Application Support:

<dependency>
    <groupId>org.dromara.milvus-plus</groupId>
    <artifactId>milvus-plus-solon-plugin</artifactId>
    <version>2.2.4</version>
</dependency>

Important Notes

  • Version 2.2.0 supports database version 2.5.x and enhances text search capabilities.
  • Starting from version 2.1.7, the groupId has been changed to org.dromara.milvus-plus. Earlier versions use org.dromara.
  • In version 2.0.0, indexes must be defined using index annotations. Otherwise, startup will fail, and adding indexes afterward will not work. You must delete the collection first.
  • The MilvusService feature has not yet been released in version 2.0.0.

Configuration File

milvus:
  uri:[https://in03-a5357975ab80da7.api.gcp-us-west1.zillizcloud.com
token:x](https://in03-a5357975ab80da7.api.gcp-us-west1.zillizcloud.com
token:x)'x'x'x
enable:true
open-log:true (default false, logging disabled)
db-name:(optional)
username:(optional)
password:(optional)
packages:
    -com.example.entity
  • milvus: Defines configuration settings related to the Milvus service.
  • uri: The URI of the Milvus service. The application communicates with the Milvus service through this URI.
  • token: An authentication and authorization token used to ensure secure access to the Milvus service.
  • enable: A Boolean value indicating whether the Milvus module should be enabled.
  • packages: These packages contain the Java classes corresponding to custom annotations. You can think of them as the packages containing your custom entity classes.
#1
资源直链https://gitee.com/dromara/MilvusPlus
去下载
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare