[Open Source] Elegantly Operate the Milvus Vector Database Using the Enhancement-Only Approach of MyBatisPlus
Open SourceClassification Systems
![[Open Source] Elegantly Operate the Milvus Vector Database Using the Enhancement-Only Approach of MyBatisPlus](https://yy123.ink/api/img/1782608439414-5aerhn.jpg)
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

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:
Spring Application Support:
Solon Application Support:
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: 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.
下载地址 免费
评论