Java SDK Reference
The Milvus Java SDK is the Java SDK for Zilliz Cloud. Its v2 client, MilvusClientV2, uses typed request builders and response objects for collection management, data operations, vector search, and cluster administration.
Features
- Typed v2 API — Build requests with Java builders and consume operation-specific response types.
- Collection and index management — Define schemas, create collections and indexes, and control collection loading.
- Data and vector operations — Insert, upsert, delete, query, search, and run hybrid searches from Java applications.
- Cloud administration — Manage databases, partitions, users, roles, and resource groups available to your cluster.
- Client pooling — Use the SDK pool classes when an application needs to manage multiple client connections.
- Optional BulkWriter artifact — Add
milvus-sdk-java-bulkwriterseparately when preparing files for bulk import.
Installation
The SDK requires Java 8 or later. Add the core artifact with Maven:
<dependency>
<groupId>io.milvus</groupId>
<artifactId>milvus-sdk-java</artifactId>
<version>3.0.8</version>
</dependency>
Or use Gradle:
implementation 'io.milvus:milvus-sdk-java:3.0.8'
Use the same release number for io.milvus:milvus-sdk-java-bulkwriter when your application needs BulkWriter. Check Maven Central or the SDK repository before pinning a version in production.
Connect to Zilliz Cloud
Copy the public endpoint from the cluster Connect card and use an API key or cluster credential as the token.
import io.milvus.v2.client.ConnectConfig;
import io.milvus.v2.client.MilvusClientV2;
import io.milvus.v2.service.collection.response.ListCollectionsResp;
String CLUSTER_ENDPOINT = "YOUR_CLUSTER_ENDPOINT";
String CLUSTER_TOKEN = "YOUR_CLUSTER_TOKEN";
ConnectConfig config = ConnectConfig.builder()
.uri(CLUSTER_ENDPOINT)
.token(CLUSTER_TOKEN)
.build();
MilvusClientV2 client = new MilvusClientV2(config);
try {
ListCollectionsResp response = client.listCollections();
System.out.println(response.getCollectionNames());
} finally {
client.close();
}
Resources
Overview
The Milvus Java SDK is the Java SDK for Zilliz Cloud. Its v2 client, MilvusClientV2, uses typed request builders and response objects for collection management, data operations, vector search, and cluster administration.
Authentication
16項目
Client
5項目
Collections
37項目
Data Import
5項目
File Resources
3項目
Management
22項目
Partitions
7項目
Snapshots
9項目
Vector
13項目
Volume
2項目
Database
8項目