diff --git a/site/zh/getstarted/install-overview.md b/site/zh/getstarted/install-overview.md index 3d9e5f828..1fc6709db 100644 --- a/site/zh/getstarted/install-overview.md +++ b/site/zh/getstarted/install-overview.md @@ -1,63 +1,62 @@ --- id: install-overview.md -summary: Milvus is a highly performant, scalable vector database. It supports use cases of a wide range of sizes, from demos running locally in Jupyter Notebooks to massive-scale Kubernetes clusters handling tens of billions of vectors. Currently, there are three Milvus deployment options_ Milvus Lite, Milvus Standalone, and Milvus Distributed. -title: Overview of Milvus Deployment Options +summary: Milvus 是一个高性能、可扩展的向量数据库。它支持各种大小的用例,从在 Jupyter Notebooks 中本地运行的演示到处理数百亿向量的大规模 Kubernetes 集群。目前,Milvus 有三种部署选项:Milvus Lite、Milvus Standalone 和 Milvus Distributed。 +title: Milvus 部署选项概述 --- -# Overview of Milvus Deployment Options +# Milvus 部署选项概述 -Milvus is a highly performant, scalable vector database. It supports use cases of a wide range of sizes, from demos running locally in Jupyter Notebooks to massive-scale Kubernetes clusters handling tens of billions of vectors. Currently, there are three Milvus deployment options: Milvus Lite, Milvus Standalone, and Milvus Distributed. +Milvus 是一个高性能、可扩展的向量数据库。它支持各种大小的用例,从在 Jupyter Notebooks 中本地运行的演示到处理数百亿向量的大规模 Kubernetes 集群。目前,Milvus 有三种部署选项:Milvus Lite、Milvus Standalone 和 Milvus Distributed。 ## Milvus Lite -[Milvus Lite](https://milvus.io/docs/milvus_lite.md) is a Python library that can be imported into your applications. As a lightweight version of Milvus, it is ideal for quick prototyping in Jupyter Notebooks or running on smart devices with limited resources. Milvus Lite supports the same APIs as other Milvus deployments. The client-side code interacting with Milvus Lite can also work with Milvus instances in other deployment modes. +[Milvus Lite](https://milvus.io/docs/milvus_lite.md) 是一个可以导入到您的应用程序中的 Python 库。作为 Milvus 的轻量级版本,它非常适合在 Jupyter Notebooks 中快速进行原型设计或在资源有限的智能设备上运行。Milvus Lite 支持与其他 Milvus 部署相同的 API。与 Milvus Lite 交互的客户端代码也可以与其他部署模式下的 Milvus 实例一起使用。 -To integrate Milvus Lite into your applications, run `pip install pymilvus` to install it and use the `MilvusClient("./demo.db")` statement to instantiate a vector database with a local file that persists all your data. For more details, refer to [Run Milvus Lite](https://milvus.io/docs/milvus_lite.md). +要将 Milvus Lite 集成到您的应用程序中,请运行 `pip install pymilvus` 进行安装,并使用 `MilvusClient("./demo.db")` 语句使用保存所有数据的本地文件实例化矢量数据库。有关更多详细信息,请参阅 [运行 Milvus Lite](https://milvus.io/docs/milvus_lite.md)。 ## Milvus Standalone -Milvus Standalone is a single-machine server deployment. All components of Milvus Standalone are packed into a single [Docker image](https://milvus.io/docs/install_standalone-docker.md), making deployment convenient. If you have a production workload but prefer not to use Kubernetes, running Milvus Standalone on a single machine with sufficient memory is a good option. Additionally, Milvus Standalone supports high availability through master-slave replication. +Milvus Standalone 是单机服务器部署。Milvus Standalone 的所有组件都打包到单个 [Docker 镜像](https://milvus.io/docs/install_standalone-docker.md) 中,部署起来非常方便。如果您有生产工作负载但不想使用 Kubernetes,那么在具有足够内存的单台机器上运行 Milvus Standalone 是一个不错的选择。此外,Milvus Standalone 通过主从复制支持高可用性。 ## Milvus Distributed -Milvus Distributed can be deployed on [Kubernetes](https://milvus.io/docs/install_cluster-milvusoperator.md) clusters. This deployment features a cloud-native architecture, where ingestion load and search queries are separately handled by isolated nodes, allowing redundancy for critical components. It offers the highest scalability and availability, as well as the flexibility in customizing the allocated resources in each component. Milvus Distributed is the top choice for enterprise users running large-scale vector search systems in production. +Milvus Distributed 可以部署在 [Kubernetes](https://milvus.io/docs/install_cluster-milvusoperator.md) 集群上。此部署具有云原生架构,其中提取负载和搜索查询由独立节点分别处理,从而为关键组件提供冗余。它提供最高的可扩展性和可用性,以及自定义每个组件中分配的资源的灵活性。 Milvus Distributed 是企业用户在生产中运行大规模向量搜索系统的首选。 -## Choose the Right Deployment for Your Use Case +## 为您的用例选择正确的部署 -The selection of a deployment mode typically depends on the development stage of your application: +部署模式的选择通常取决于应用程序的开发阶段: -- **For Quick Prototyping** +- **用于快速原型设计** - If you would like to quickly build something as a prototype or for learning purposes, such as Retrieval Augmented Generation (RAG) demos, AI chatbots, multi-modality search, Milvus Lite itself or a combination of Milvus Lite and Milvus Standalone is suitable. You can use Milvus Lite in notebooks for rapid prototyping and explore various approaches such as different chunking strategies in RAG. You may want to deploy the application built with Milvus Lite in a small-scale production to serve real users, or validating the idea on larger datasets, say more than a few millions of vectors. Milvus Standalone is appropriate. The application logic for Milvus Lite can still be shared as all Milvus deployments have the same client side API. The data stored in Milvus Lite can also be ported to Milvus Standalone with a command line tool. +如果您想快速构建某些东西作为原型或用于学习目的,例如检索增强生成 (RAG) 演示、AI 聊天机器人、多模态搜索,Milvus Lite 本身或 Milvus Lite 和 Milvus Standalone 的组合都适用。您可以在笔记本中使用 Milvus Lite 进行快速原型设计,并探索各种方法,例如 RAG 中的不同分块策略。您可能希望在小规模生产中部署使用 Milvus Lite 构建的应用程序以服务于真实用户,或者在更大的数据集上验证该想法,比如几百万个向量。Milvus Standalone 是合适的。Milvus Lite 的应用程序逻辑仍然可以共享,因为所有 Milvus 部署都具有相同的客户端 API。 Milvus Lite 中存储的数据也可以通过命令行工具移植到 Milvus Standalone。 -- **Small-Scale Production Deployment** +- **小规模生产部署** - For early-stage production, when the project is still seeking product-market fit and agility is more important than scalability, Milvus Standalone is the best choice. It can still scale up to 100M vectors given enough machine resource, while requiring much less DevOps than maintaining a K8s cluster. +对于早期生产,当项目仍在寻求产品与市场的契合度,敏捷性比可扩展性更重要时,Milvus Standalone 是最佳选择。在有足够的机器资源的情况下,它仍然可以扩展到 100M 个向量,同时所需的 DevOps 比维护 K8s 集群要少得多。 -- **Large-Scale Production Deployment** +- **大规模生产部署** - As your business is rapidly growing and the data scale exceeds the capacity of a single server, it's time to consider Milvus Distributed. You can keep using Milvus Standalone for dev or staging environment for its convenience, and operate the K8s cluster that runs Milvus Distributed. This can sustain you towards tens of billions of vectors, as well as providing flexibility on tailoring the node size for your particular workload, such as high-read, infrequent write or high-write, low read cases. +随着您的业务快速增长,数据规模超出了单个服务器的容量,是时候考虑 Milvus Distributed 了。您可以继续使用 Milvus Standalone 作为开发或预发布环境,以方便使用,并操作运行 Milvus Distributed 的 K8s 集群。这可以支持您处理数百亿个向量,并可以灵活地根据特定工作负载(例如高读取、不频繁写入或高写入、低读取的情况)定制节点大小。 -- **Local Search on Edge Devices** +- **边缘设备上的本地搜索** - For searching through private or sensitive on edge devices, you can deploy Milvus Lite on the device without relying on a cloud-based service to do text or image search. This is suitable for cases such as proprietary document search, or on-device object detection. +如需在边缘设备上搜索私人或敏感信息,您可以在设备上部署 Milvus Lite,而无需依赖基于云的服务进行文本或图像搜索。这适用于专有文档搜索或设备上对象检测等情况。 -The choice of Milvus deployment mode depends on your project's stage and scale. Milvus provides a flexible and powerful solution for various needs, from rapid prototyping to large-scale enterprise deployment. +Milvus 部署模式的选择取决于您项目的阶段和规模。Milvus 为各种需求提供了灵活而强大的解决方案,从快速原型设计到大规模企业部署。 -- **Milvus Lite** is recommended for smaller datasets, up to a few million vectors. -- **Milvus Standalone** is suitable for medium-sized datasets, scaling up to 100 million vectors. -- **Milvus Distributed** is designed for large-scale deployments, capable of handling datasets from 100 million up to tens of billions of vectors. +- **Milvus Lite** 建议用于较小的数据集,最多几百万个向量。 +- **Milvus Standalone** 适用于中型数据集,可扩展至 1 亿个向量。 +- **Milvus Distributed** 专为大规模部署而设计,能够处理从 1 亿到数百亿向量的数据集。 -![Select deployment option for your use case](../../../assets/select-deployment-option.png) +![为您的用例选择部署选项](../../../assets/select-deployment-option.png) -## Comparison on functionalities +## 功能比较 | Feature | Milvus Lite | Milvus Standalone | Milvus Distributed | -|--------------------------|---------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------| +| ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | SDK / Client Lirary | Python
gRPC | Python
Go
Java
Node.js
C#
RESTful | Python
Java
Go
Node.js
C#
RESTful | | Data types | Dense Vector
Sparse Vector
Binary Vector
Boolean
Integer
Floating Point
VarChar
Array
JSON | Dense Vector
Sparse Vector
Binary Vector
Boolean
Integer
Floating Point
VarChar
Array
JSON | Dense Vector
Sparse Vector
Binary Vector
Boolean
Integer
Floating Point
VarChar
Array
JSON | | Search capabilities | Vector Search (ANN Search)
Metadata Filtering
Range Search
Scalar Query
Get Entities by Primary Key
Hybrid Search | Vector Search (ANN Search)
Metadata Filtering
Range Search
Scalar Query
Get Entities by Primary Key
Hybrid Search | Vector Search (ANN Search)
Metadata Filtering
Range Search
Scalar Query
Get Entities by Primary Key
Hybrid Search | | CRUD operations | ✔️ | ✔️ | ✔️ | | Advanced data management | N/A | Access Control
Partition
Partition Key | Access Control
Partition
Partition Key
Physical Resource Grouping | | Consistency Levels | Strong | Strong
Bounded Staleness
Session
Eventual | Strong
Bounded Staleness
Session
Eventual | - diff --git a/site/zh/getstarted/install_SDKs/install-go.md b/site/zh/getstarted/install_SDKs/install-go.md index 5ccff3c81..c83e893d3 100644 --- a/site/zh/getstarted/install_SDKs/install-go.md +++ b/site/zh/getstarted/install_SDKs/install-go.md @@ -1,38 +1,36 @@ --- id: install-go.md -label: Install GO SDK +label: 安装 GO SDK related_key: SDK -summary: Learn how to install the GO SDK of Milvus. -title: Install Milvus Go SDK +summary: 了解如何安装 Milvus 的 GO SDK。 +title: 安装 Milvus Go SDK --- -# Install Milvus Go SDK +# 安装 Milvus Go SDK -This topic describes how to install Milvus Go SDK for Milvus. +本主题介绍如何为 Milvus 安装 Milvus Go SDK。 -Current version of Milvus supports SDKs in Python, Node.js, GO, and Java. +当前版本的 Milvus 支持 Python、Node.js、GO 和 Java 中的 SDK。 -## Requirement +## 要求 -GO (1.17 or later) is required. +需要 GO(1.17 或更高版本)。 -## Install Milvus GO SDK +## 安装 Milvus GO SDK -Install the Milvus GO SDK and dependencies via `go get`. +通过 `go get` 安装 Milvus GO SDK 和依赖项。 ```bash $ go get -u github.com/milvus-io/milvus-sdk-go/v2 ``` -## What's next - -Having installed Milvus GO SDK, you can: - -- Learn the basic operations of Milvus: - - [Manage Collections](manage-collections.md) - - [Manage Partitions](manage-partitions.md) - - [Insert, Upsert & Delete](insert-update-delete.md) - - [Single-Vector Search](single-vector-search.md) - - [Hybrid Search](multi-vector-search.md) +## 下一步 +安装 Milvus GO SDK 后,您可以: +- 了解 Milvus 的基本操作: +- [管理集合](manage-collections.md) +- [管理分区](manage-partitions.md) +- [插入、更新插入和删除](insert-update-delete.md) +- [单向量搜索](single-vector-search.md) +- [混合搜索](multi-vector-search.md) \ No newline at end of file diff --git a/site/zh/getstarted/install_SDKs/install-java.md b/site/zh/getstarted/install_SDKs/install-java.md index d67f65e5e..333785ecc 100644 --- a/site/zh/getstarted/install_SDKs/install-java.md +++ b/site/zh/getstarted/install_SDKs/install-java.md @@ -1,33 +1,33 @@ --- id: install-java.md -label: Install Java SDK +label: 安装 Java SDK related_key: SDK -summary: Learn how to install the Java SDK of Milvus. -title: Install Milvus Java SDK +summary: 了解如何安装 Milvus 的 Java SDK。 +title: 安装 Milvus Java SDK --- -# Install Milvus Java SDK +# 安装 Milvus Java SDK -This topic describes how to install Milvus Java SDK for Milvus. +本主题介绍如何为 Milvus 安装 Milvus Java SDK。 -Current version of Milvus supports SDKs in Python, Node.js, GO, and Java. +当前版本的 Milvus 支持 Python、Node.js、GO 和 Java 中的 SDK。 -## Requirement +## 要求 -- Java (8 or later) -- Apache Maven or Gradle/Grails +- Java(8 或更高版本) +- Apache Maven 或 Gradle/Grails -## Install Milvus Java SDK +## 安装 Milvus Java SDK -Run the following command to install Milvus Java SDK. +运行以下命令安装 Milvus Java SDK。 - Apache Maven ```xml - io.milvus - milvus-sdk-java - {{var.milvus_java_sdk_real_version}} +io.milvus +milvus-sdk-java +{{var.milvus_java_sdk_real_version}}} ``` @@ -37,16 +37,15 @@ Run the following command to install Milvus Java SDK. implementation 'io.milvus:milvus-sdk-java:{{var.milvus_java_sdk_real_version}}' ``` -## What's next +## 下一步 -Having installed Milvus Java SDK, you can: +安装 Milvus Java SDK 后,您可以: -- Learn the basic operations of Milvus: - - [Manage Collections](manage-collections.md) - - [Manage Partitions](manage-partitions.md) - - [Insert, Upsert & Delete](insert-update-delete.md) - - [Single-Vector Search](single-vector-search.md) - - [Hybrid Search](multi-vector-search.md) - -- Explore [Milvus Java API reference](/api-reference/java/v{{var.milvus_java_sdk_version}}/About.md) +- 了解 Milvus 的基本操作: +- [管理集合](manage-collections.md) +- [管理分区](manage-partitions.md) +- [插入、更新插入和删除](insert-update-delete.md) +- [单向量搜索](single-vector-search.md) +- [混合搜索](multi-vector-search.md) +- 探索 [Milvus Java API 参考](/api-reference/java/v{{var.milvus_java_sdk_version}}/About.md) diff --git a/site/zh/getstarted/install_SDKs/install-node.md b/site/zh/getstarted/install_SDKs/install-node.md index 1143ceba4..18fcbba5b 100644 --- a/site/zh/getstarted/install_SDKs/install-node.md +++ b/site/zh/getstarted/install_SDKs/install-node.md @@ -1,56 +1,54 @@ --- id: install-node.md -label: Install Node.js SDK +label: 安装 Node.js SDK related_key: SDK -summary: Learn how to install the Node.js SDK of Milvus. -title: Install Milvus Nodejs SDK +summary: 了解如何安装 Milvus 的 Node.js SDK。 +title: 安装 Milvus Nodejs SDK --- -# Install Milvus Nodejs SDK +# 安装 Milvus Nodejs SDK -This topic describes how to install Milvus Node.js SDK for Milvus. +本主题介绍如何为 Milvus 安装 Milvus Node.js SDK。 -## Compatibility +## 兼容性 -The following collection shows Milvus versions and recommended @zilliz/milvus2-sdk-node versions: +以下集合显示了 Milvus 版本和推荐的 @zilliz/milvus2-sdk-node 版本: -| Milvus version | Recommended @zilliz/milvus2-sdk-node version | -| :------------: | :------------------------------------------: | -| 2.4.x | 2.4.x | -| 2.3.x | 2.3.x | -| 2.2.x | 2.2.x | -| 2.1.x | 2.1.x | -| 2.0.1 | 2.0.0, 2.0.1 | -| 2.0.0 | 2.0.0 | +| Milvus 版本 | 推荐的 @zilliz/milvus2-sdk-node 版本 | +| :---------: | :----------------------------------: | +| 2.4.x | 2.4.x | +| 2.3.x | 2.3.x | +| 2.2.x | 2.2.x | +| 2.1.x | 2.1.x | +| 2.0.1 | 2.0.0, 2.0.1 | +| 2.0.0 | 2.0.0 | -## Requirement +## 要求 Node.js v18+ -## Installation +## 安装 -The recommended way to get started using the Milvus node.js client is by using npm (Node package manager) to install the dependency in your project. +开始使用 Milvus node.js 客户端的推荐方法是使用 npm(Node 包管理器)在您的项目中安装依赖项。 ```javascript npm install @zilliz/milvus2-sdk-node -# or ... +# 或 ... yarn add @zilliz/milvus2-sdk-node ``` -This will download the Milvus node.js sdk and add a dependency entry in your package.json file. +这将下载 Milvus node.js sdk 并在您的 package.json 文件中添加依赖项条目。 -## What's next +## 下一步 -Having installed Milvus Node.js SDK, you can: +安装 Milvus Node.js SDK 后,您可以: +- 查看 [milvus node.js sdk 快速入门](https://github.com/milvus-io/milvus-sdk-node) +- 了解 Milvus 的基本操作: +- [管理集合](manage-collections.md) +- [管理分区](manage-partitions.md) +- [插入、更新插入和删除](insert-update-delete.md) +- [单向量搜索](single-vector-search.md) +- [混合搜索](multi-vector-search.md) -- View [quick start of milvus node.js sdk](https://github.com/milvus-io/milvus-sdk-node) -- Learn the basic operations of Milvus: - - [Manage Collections](manage-collections.md) - - [Manage Partitions](manage-partitions.md) - - [Insert, Upsert & Delete](insert-update-delete.md) - - [Single-Vector Search](single-vector-search.md) - - [Hybrid Search](multi-vector-search.md) - -- Explore [Milvus Node.js API reference](/api-reference/node/v{{var.milvus_node_sdk_version}}/About.md) - +- 浏览 [Milvus Node.js API 参考](/api-reference/node/v{{var.milvus_node_sdk_version}}/About.md) diff --git a/site/zh/getstarted/install_SDKs/install-pymilvus.md b/site/zh/getstarted/install_SDKs/install-pymilvus.md index abb63d451..e9f6f9917 100644 --- a/site/zh/getstarted/install_SDKs/install-pymilvus.md +++ b/site/zh/getstarted/install_SDKs/install-pymilvus.md @@ -1,55 +1,52 @@ --- id: install-pymilvus.md -label: Install PyMilvus +label: 安装 PyMilvus related_key: SDK -summary: Learn how to install the Python SDK of Milvus. -title: Install Milvus Python SDK +summary: 了解如何安装 Milvus 的 Python SDK。 +title: 安装 Milvus Python SDK --- -# Install Milvus Python SDK +# 安装 Milvus Python SDK -This topic describes how to install Milvus python SDK pymilvus for Milvus. +本主题介绍如何为 Milvus 安装 Milvus python SDK pymilvus。 -Current version of Milvus supports SDKs in Python, Node.js, GO, and Java. +Milvus 的当前版本支持 Python、Node.js、GO 和 Java 中的 SDK。 -## Requirements +## 要求 -- Python 3.7 or later is required. -- Google protobuf is installed. You can install it with the command `pip3 install protobuf==3.20.0`. -- grpcio-tools is installed. You can install it with the command `pip3 install grpcio-tools`. +- 需要 Python 3.7 或更高版本。 +- 已安装 Google protobuf。您可以使用命令 `pip3 install protobuf==3.20.0` 安装它。 +- 已安装 grpcio-tools。您可以使用命令 `pip3 install grpcio-tools` 安装它。 -## Install PyMilvus via pip +## 通过 pip 安装 PyMilvus -PyMilvus is available in [Python Package Index](https://pypi.org/project/pymilvus/). +PyMilvus 可在 [Python 包索引](https://pypi.org/project/pymilvus/) 中找到。
-It is recommended to install a PyMilvus version that matches the version of the Milvus server you installed. For more information, see Release Notes. +建议安装与所安装 Milvus 服务器版本匹配的 PyMilvus 版本。有关详细信息,请参阅发布说明
``` $ python3 -m pip install pymilvus=={{var.milvus_python_sdk_real_version}} ``` -## Verify installation +## 验证安装 -If PyMilvus is correctly installed, no exception will be raised when you run the following command. +如果 PyMilvus 正确安装,则运行以下命令时不会引发任何异常。 ``` $ python3 -c "from pymilvus import Collection" ``` +## 下一步 +安装 PyMilvus 后,您可以: -## What's next - -Having installed PyMilvus, you can: - -- Learn the basic operations of Milvus: - - [Manage Collections](manage-collections.md) - - [Manage Partitions](manage-partitions.md) - - [Insert, Upsert & Delete](insert-update-delete.md) - - [Single-Vector Search](single-vector-search.md) - - [Hybrid Search](multi-vector-search.md) - -- Explore [PyMilvus API reference](/api-reference/pymilvus/v{{var.milvus_python_sdk_version}}/About.md) +- 了解 Milvus 的基本操作: +- [管理集合](manage-collections.md) +- [管理分区](manage-partitions.md) +- [插入、更新插入和删除](insert-update-delete.md) +- [单向量搜索](single-vector-search.md) +- [混合搜索](multi-vector-search.md) +- 探索 [PyMilvus API 参考](/api-reference/pymilvus/v{{var.milvus_python_sdk_version}}/About.md) diff --git a/site/zh/getstarted/milvus_lite.md b/site/zh/getstarted/milvus_lite.md index 7c8ad0826..f79efadfe 100644 --- a/site/zh/getstarted/milvus_lite.md +++ b/site/zh/getstarted/milvus_lite.md @@ -1,61 +1,61 @@ --- id: milvus_lite.md -summary: Get started with Milvus Lite. -title: Run Milvus Lite Locally +summary: 开始使用 Milvus Lite。 +title: 在本地运行 Milvus Lite --- -# Run Milvus Lite Locally +# 在本地运行 Milvus Lite -This page illustrates how to run Milvus locally with Milvus Lite. Milvus Lite is the lightweight version of [Milvus](https://github.com/milvus-io/milvus), an open-source vector database that powers AI applications with vector embeddings and similarity search. +本页说明如何使用 Milvus Lite 在本地运行 Milvus。Milvus Lite 是 [Milvus](https://github.com/milvus-io/milvus) 的轻量级版本,Milvus 是一个开源向量数据库,为 AI 应用程序提供向量嵌入和相似性搜索功能。 +## 概述 -## Overview +Milvus Lite 可以导入到您的 Python 应用程序中,提供 Milvus 的核心向量搜索功能。Milvus Lite 已包含在 [Milvus 的 Python SDK](https://github.com/milvus-io/pymilvus) 中。只需使用 `pip install pymilvus` 即可轻松部署。 -Milvus Lite can be imported into your Python application, providing the core vector search functionality of Milvus. Milvus Lite is already included in the [Python SDK of Milvus](https://github.com/milvus-io/pymilvus). It can be simply deployed with `pip install pymilvus`. +使用 Milvus Lite,您可以在几分钟内开始构建具有向量相似性搜索的 AI 应用程序! Milvus Lite 适合在以下环境中运行: -With Milvus Lite, you can start building an AI application with vector similarity search within minutes! Milvus Lite is good for running in the following environment: - Jupyter Notebook / Google Colab -- Laptops -- Edge Devices +- 笔记本电脑 +- 边缘设备 -Milvus Lite shares the same API with Milvus Standalone and Distributed, and covers most of the features such as vector data persistence and management, vector CRUD operations, sparse and dense vector search, metadata filtering, multi-vector and hybrid_search. Together, they provide a consistent experience across different types of environments, from edge devices to clusters in cloud, fitting use cases of different size. With the same client-side code, you can run GenAI apps with Milvus Lite on a laptop or Jupyter Notebook, or Milvus Standalone on Docker container, or Milvus Distributed on massive scale Kubernetes cluster serving billions of vectors in production. +Milvus Lite 与 Milvus Standalone 和 Distributed 共享相同的 API,并涵盖大多数功能,例如向量数据持久化和管理、向量 CRUD 操作、稀疏和密集向量搜索、元数据过滤、多向量和 hybrid_search。它们共同为不同类型的环境(从边缘设备到云中的集群)提供一致的体验,适合不同规模的用例。使用相同的客户端代码,您可以在笔记本电脑或 Jupyter Notebook 上使用 Milvus Lite 运行 GenAI 应用程序,或在 Docker 容器上使用 Milvus Standalone,或在大规模 Kubernetes 集群上使用 Milvus Distributed 运行,为生产中的数十亿个向量提供服务。 -## Prerequisites +## 先决条件 -Milvus Lite currently supports the following environmnets: -- Ubuntu >= 20.04 (x86_64 and arm64) -- MacOS >= 11.0 (Apple Silicon M1/M2 and x86_64) +Milvus Lite 目前支持以下环境: -Please note that Milvus Lite is only suitable for small scale vector search use cases. For a large scale use case, we recommend using [Milvus Standalone](https://milvus.io/docs/install-overview.md#Milvus-Standalone) or [Milvus Distributed](https://milvus.io/docs/install-overview.md#Milvus-Distributed). You can also consider the fully-managed Milvus on [Zilliz Cloud](https://zilliz.com/cloud). +- Ubuntu >= 20.04(x86_64 和 arm64) +- MacOS >= 11.0(Apple Silicon M1/M2 和 x86_64) +请注意,Milvus Lite 仅适用于小规模向量搜索用例。对于大规模用例,我们建议使用 [Milvus Standalone](https://milvus.io/docs/install-overview.md#Milvus-Standalone) 或 [Milvus Distributed](https://milvus.io/docs/install-overview.md#Milvus-Distributed)。您还可以考虑在 [Zilliz Cloud](https://zilliz.com/cloud) 上使用完全托管的 Milvus。 -## Set up Milvus Lite +## 设置 Milvus Lite ```shell pip install -U pymilvus ``` -We recommend using `pymilvus`. Since `milvus-lite` is included in `pymilvus` version 2.4.2 or above, you can `pip install` with `-U` to force update to the latest version and `milvus-lite` is automatically installed. +我们建议使用 `pymilvus`。由于 `pymilvus` 2.4.2 或更高版本中包含 `milvus-lite`,因此您可以使用 `-U` 进行 `pip install` 以强制更新到最新版本,并且 `milvus-lite` 会自动安装。 -If you want to explicitly install `milvus-lite` package, or you have installed an older version of `milvus-lite` and would like to update it, you can do `pip install -U milvus-lite`. +如果您想明确安装 `milvus-lite` 包,或者您已经安装了旧版本的 `milvus-lite` 并想更新它,您可以执行 `pip install -U milvus-lite`。 -## Connect to Milvus Lite +## 连接到 Milvus Lite + +在 `pymilvus` 中,指定本地文件名作为 MilvusClient 的 uri 参数将使用 Milvus Lite。 -In `pymilvus`, specify a local file name as uri parameter of MilvusClient will use Milvus Lite. ```python from pymilvus import MilvusClient client = MilvusClient("./milvus_demo.db") ``` -After running the above code snippet, a database file named **milvus_demo.db** will be generated in the current folder. +运行上述代码片段后,当前文件夹中会生成一个名为 **milvus_demo.db** 的数据库文件。 -> **_NOTE:_** Note that the same API also applies to Milvus Standalone, Milvus Distributed and Zilliz Cloud, the only difference is to replace local file name to remote server endpoint and credentials, e.g. -`client = MilvusClient(uri="http://localhost:19530", token="username:password")`. +> **_NOTE:_** 请注意,相同的 API 也适用于 Milvus Standalone、Milvus Distributed 和 Zilliz Cloud,唯一的区别是将本地文件名替换为远程服务器端点和凭据,例如 +> `client = MilvusClient(uri="http://localhost:19530", token="username:password")`。 -# Examples +# 示例 -Following is a simple demo showing how to use Milvus Lite for text search. There are more comprehensive [examples](https://github.com/milvus-io/bootcamp/tree/master/bootcamp/tutorials) for using Milvus Lite to build applications -such as [RAG](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/quickstart/build_RAG_with_milvus.ipynb), [image search](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/quickstart/image_search_with_milvus.ipynb), and using Milvus Lite in popular RAG framework such as [LangChain](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/integration/rag_with_milvus_and_langchain.ipynb) and [LlamaIndex](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/integration/rag_with_milvus_and_llamaindex.ipynb)! +以下是一个简单的演示,展示如何使用 Milvus Lite 进行文本搜索。还有更多全面的使用 Milvus Lite 构建应用程序的 [示例](https://github.com/milvus-io/bootcamp/tree/master/bootcamp/tutorials),例如 [RAG](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/quickstart/build_RAG_with_milvus.ipynb)、[图像搜索](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/quickstart/image_search_with_milvus.ipynb),以及在流行的 RAG 框架中使用 Milvus Lite,例如 [LangChain](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/integration/rag_with_milvus_and_langchain.ipynb) 和[LlamaIndex](https://github.com/milvus-io/bootcamp/blob/master/bootcamp/tutorials/integration/rag_with_milvus_and_llamaindex.ipynb)! ```python from pymilvus import MilvusClient @@ -63,92 +63,92 @@ import numpy as np client = MilvusClient("./milvus_demo.db") client.create_collection( - collection_name="demo_collection", - dimension=384 # The vectors we will use in this demo has 384 dimensions +collection_name="demo_collection", +dimension=384 # 我们将在此演示中使用的向量有 384 个维度 ) -# Text strings to search from. +# 要搜索的文本字符串。 docs = [ - "Artificial intelligence was founded as an academic discipline in 1956.", - "Alan Turing was the first person to conduct substantial research in AI.", - "Born in Maida Vale, London, Turing was raised in southern England.", +“人工智能于 1956 年作为一门学科成立。”, +“艾伦·图灵是第一个对人工智能进行实质性研究的人。”, +“图灵出生于伦敦梅达维尔,在英格兰南部长大。”, ] -# For illustration, here we use fake vectors with random numbers (384 dimension). +# 为了说明,我们在这里使用带有随机数的假向量(384 维)。 vectors = [[ np.random.uniform(-1, 1) for _ in range(384) ] for _ in range(len(docs)) ] data = [ {"id": i, "vector": vectors[i], "text": docs[i], "subject": "history"} for i in range(len(vectors)) ] res = client.insert( - collection_name="demo_collection", - data=data +collection_name="demo_collection", +data=data ) -# This will exclude any text in "history" subject despite close to the query vector. +# 这将排除“history”主题中的任何文本,尽管它接近查询向量。 res = client.search( - collection_name="demo_collection", - data=[vectors[0]], - filter="subject == 'history'", - limit=2, - output_fields=["text", "subject"], +collection_name="demo_collection", +data=[vectors[0]], +filter="subject == 'history'", +limit=2, +output_fields=["text", "subject"], ) print(res) -# a query that retrieves all entities matching filter expressions. +# 检索所有匹配过滤表达式的实体的查询。 res = client.query( - collection_name="demo_collection", - filter="subject == 'history'", - output_fields=["text", "subject"], +collection_name="demo_collection", +filter="subject == 'history'", +output_fields=["text", "subject"], ) print(res) -# delete +# 删除 res = client.delete( - collection_name="demo_collection", - filter="subject == 'history'", +collection_name="demo_collection", +filter="subject == 'history'", ) print(res) ``` -## Limits +## 限制 -When running Milvus Lite, note that some features are not supported. The following tables summarize the usage limits on Milvus Lite. +运行 Milvus Lite 时,请注意某些功能不受支持。下表总结了 Milvus Lite 的使用限制。 ### Collection -| Method / Parameter | Supported in Milvus Lite | -|----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------| -| [create_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_collection.md) | Support with limited parameters | -| `collection_name` | Y | -| `dimension` | Y | -| `primary_field_name` | Y | -| `id_type` | Y | -| `vector_field_name` | Y | -| `metric_type` | Y | -| `auto_id` | Y | -| `schema` | Y | -| `index_params` | Y | -| `enable_dynamic_field` | Y | -| `num_shards` | N | -| `partition_key_field` | N | -| `num_partitions` | N | -| `consistency_level` | N (Only supports `Strong`; Any configuration will be treated as `Strong`.) | -| [get_collection_stats()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/get_collection_stats.md) | Supports getting collection statistics. | -| `collection_name` | Y | -| `timeout` | Y | +| Method / Parameter | Supported in Milvus Lite | +| -------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| [create_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_collection.md) | Support with limited parameters | +| `collection_name` | Y | +| `dimension` | Y | +| `primary_field_name` | Y | +| `id_type` | Y | +| `vector_field_name` | Y | +| `metric_type` | Y | +| `auto_id` | Y | +| `schema` | Y | +| `index_params` | Y | +| `enable_dynamic_field` | Y | +| `num_shards` | N | +| `partition_key_field` | N | +| `num_partitions` | N | +| `consistency_level` | N (Only supports `Strong`; Any configuration will be treated as `Strong`.) | +| [get_collection_stats()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/get_collection_stats.md) | Supports getting collection statistics. | +| `collection_name` | Y | +| `timeout` | Y | | [describe_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/describe_collection.md) | `num_shards`, `consistency_level`, and `collection_id` in response are invalid. | -| `timeout` | Y | -| [has_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/has_collection.md) | Supports checking if a collection exists. | -| `collection_name` | Y | -| `timeout` | Y | -| [list_collections()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/list_collections.md) | Supports listing all collections. | -| [drop_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/drop_collection.md) | Supports dropping a collection. | -| `collection_name` | Y | -| `timeout` | Y | -| [rename_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/rename_collection.md) | Renaming a collection is not supported. | +| `timeout` | Y | +| [has_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/has_collection.md) | Supports checking if a collection exists. | +| `collection_name` | Y | +| `timeout` | Y | +| [list_collections()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/list_collections.md) | Supports listing all collections. | +| [drop_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/drop_collection.md) | Supports dropping a collection. | +| `collection_name` | Y | +| `timeout` | Y | +| [rename_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/rename_collection.md) | Renaming a collection is not supported. | ### Field & Schema -| Method / Parameter | Supported in Milvus Lite | -|--------------------------------------------------------------------------------------------------------------|---------------------------------| +| Method / Parameter | Supported in Milvus Lite | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------- | | [create_schema()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_schema.md) | Support with limited parameters | | `auto_id` | Y | | `enable_dynamic_field` | Y | @@ -166,8 +166,8 @@ When running Milvus Lite, note that some features are not supported. The followi ### Insert & Search -| Method / Parameter | Supported in Milvus Lite | -|-------------------------------------------------------------------------------------------|---------------------------------| +| Method / Parameter | Supported in Milvus Lite | +| ----------------------------------------------------------------------------------------- | ------------------------------- | | [search()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Vector/search.md) | Support with limited parameters | | `collection_name` | Y | | `data` | Y | @@ -185,7 +185,7 @@ When running Milvus Lite, note that some features are not supported. The followi | `timeout` | Y | | `ids` | Y | | `partition_names` | N | -| [get()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Vector/get.md) | Support with limited parameters | +| [get()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Vector/get.md) | Support with limited parameters | | `collection_name` | Y | | `ids` | Y | | `output_fields` | Y | @@ -210,22 +210,22 @@ When running Milvus Lite, note that some features are not supported. The followi ### Load & Release -| Method / Parameter | Supported in Milvus Lite | -|-----------------------------------------------------------------------------------------------------------------------|--------------------------| -| [load_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/load_collection.md) | Y | -| `collection_name` | Y | -| `timeout` | Y | -| [release_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/release_collection.md) | Y | -| `collection_name` | Y | -| `timeout` | Y | -| [get_load_state()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/get_load_state.md) | Getting load status is not supported. | -| [refresh_load()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/refresh_load.md) | Loading the unloaded data of a loaded collection is not supported. | -| [close()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Client/close.md) | Y | +| Method / Parameter | Supported in Milvus Lite | +| --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | +| [load_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/load_collection.md) | Y | +| `collection_name` | Y | +| `timeout` | Y | +| [release_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/release_collection.md) | Y | +| `collection_name` | Y | +| `timeout` | Y | +| [get_load_state()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/get_load_state.md) | Getting load status is not supported. | +| [refresh_load()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/refresh_load.md) | Loading the unloaded data of a loaded collection is not supported. | +| [close()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Client/close.md) | Y | ### Index -| Method / Parameter | Supported in Milvus Lite | -|----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------| +| Method / Parameter | Supported in Milvus Lite | +| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | | [list_indexes()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/list_collections.md) | Listing indexes is supported. | | `collection_name` | Y | | `field_name` | Y | @@ -241,82 +241,84 @@ When running Milvus Lite, note that some features are not supported. The followi | `index_name` | Y | | `timeout` | Y | -### Vector Index Types +### 向量索引类型 + +Milvus Lite 仅支持 [FLAT](https://milvus.io/docs/index.md?tab=floating#FLAT) 索引类型。无论集合中指定的索引类型如何,它都使用 FLAT 类型。 -Milvus Lite only supports [FLAT](https://milvus.io/docs/index.md?tab=floating#FLAT) index type. It uses FLAT type regardless of the specified index type in collection. +### 搜索功能 -### Search Features +Milvus Lite 支持稀疏向量、多向量、混合搜索。 -Milvus Lite supports Sparse Vector, Multi-vector, Hybrid Search. +### 分区 -### Partition +Milvus Lite 不支持分区和分区相关方法。 -Milvus Lite does not support partitions and partition-related methods. +### 用户和角色 -### Users & Roles +Milvus Lite 不支持用户和角色以及相关方法。 -Milvus Lite does not support users and roles and related methods. +### 别名 -### Alias +Milvus Lite 不支持别名和别名相关方法。 -Milvus Lite does not support aliases and alias-related methods. +# 从 Milvus Lite 迁移数据 -# Migrating data from Milvus Lite -All data stored in Milvus Lite can be easily exported and loaded into other types of Milvus deployment, such as Milvus Standalone on Docker, Milvus Distributed on K8s, or fully-managed Milvus on [Zilliz Cloud](https://zilliz.com/cloud). +Milvus Lite 中存储的所有数据都可以轻松导出并加载到其他类型的 Milvus 部署中,例如 Docker 上的 Milvus Standalone、K8s 上的 Milvus Distributed 或 [Zilliz Cloud](https://zilliz.com/cloud) 上完全托管的 Milvus。 -Milvus Lite provides a command line tool that can dump data into a json file, which can be imported into [milvus](https://github.com/milvus-io/milvus) and [Zilliz Cloud](https://zilliz.com/cloud)(the fully managed cloud service for Milvus). The milvus-lite command will be installed together with milvus-lite python package +Milvus Lite 提供了一个命令行工具,可以将数据转储到 json 文件中,该文件可以导入 [milvus](https://github.com/milvus-io/milvus) 和 [Zilliz Cloud](https://zilliz.com/cloud)(Milvus 的完全托管云服务)。 milvus-lite 命令将与 milvus-lite python 包一起安装 ```shell -# Install +# 安装 pip install -U "pymilvus[bulk_writer]" milvus-lite dump -h -usage: milvus-lite dump [-h] [-d DB_FILE] [-c COLLECTION] [-p PATH] +用法:milvus-lite dump [-h] [-d DB_FILE] [-c COLLECTION] [-p PATH] -optional arguments: - -h, --help show this help message and exit - -d DB_FILE, --db-file DB_FILE - milvus lite db file - -c COLLECTION, --collection COLLECTION - collection that need to be dumped - -p PATH, --path PATH dump file storage dir +可选参数: +-h, --help 显示此帮助消息并退出 +-d DB_FILE, --db-file DB_FILE +milvus lite db 文件 +-c COLLECTION, --collection COLLECTION +需要转储的集合 +-p PATH, --path PATH 转储文件存储目录 ``` -The following example dumps all data from `demo_collection` collection that's stored in `./milvus_demo.db` (Milvus Lite database file) -To export data: +以下示例转储存储在 `./milvus_demo.db`(Milvus Lite 数据库文件)中的 `demo_collection` 集合中的所有数据 + +要导出数据: ```shell milvus-lite dump -d ./milvus_demo.db -c demo_collection -p ./data_dir -# ./milvus_demo.db: milvus lite db file -# demo_collection: collection that need to be dumped -#./data_dir : dump file storage dir +# ./milvus_demo.db:milvus lite db 文件 +# demo_collection:需要转储的集合 +#./data_dir:转储文件存储目录 ``` -With the dump file, you can upload data to Zilliz Cloud via [Data Import](https://docs.zilliz.com/docs/data-import), or upload data to Milvus servers via [Bulk Insert](https://milvus.io/docs/import-data.md). +使用转储文件,您可以通过 [数据导入](https://docs.zilliz.com/docs/data-import) 将数据上传到 Zilliz Cloud,或通过 [批量插入](https://milvus.io/docs/import-data.md) 将数据上传到 Milvus 服务器。 +## 下一步 -## What's next +连接到 Milvus Lite 后,您可以: -Having connected to Milvus Lite, you can: +- 查看 [快速入门](quickstart.md) 了解 Milvus 可以做什么。 -- Check [Quickstart](quickstart.md) to see what Milvus can do. +- 了解 Milvus 的基本操作: -- Learn the basic operations of Milvus: - - [Manage Databases](manage_databases.md) - - [Manage Collections](manage-collections.md) - - [Manage Partitions](manage-partitions.md) - - [Insert, Upsert & Delete](insert-update-delete.md) - - [Single-Vector Search](single-vector-search.md) - - [Hybrid Search](multi-vector-search.md) +- [管理数据库](manage_databases.md) +- [管理集合](manage-collections.md) +- [管理分区](manage-partitions.md) +- [插入、更新插入和删除](insert-update-delete.md) +- [单向量搜索](single-vector-search.md) +- [混合搜索](multi-vector-search.md) -- [Upgrade Milvus Using Helm Chart](upgrade_milvus_cluster-helm.md). -- [Scale your Milvus cluster](scaleout.md). -- Deploy your Milvus cluster on clouds: - - [Amazon EKS](eks.md) - - [Google Cloud](gcp.md) - - [Microsoft Azure](azure.md) -- Explore [Milvus Backup](milvus_backup_overview.md), an open-source tool for Milvus data backups. -- Explore [Birdwatcher](birdwatcher_overview.md), an open-source tool for debugging Milvus and dynamic configuration updates. -- Explore [Attu](https://milvus.io/docs/attu.md), an open-source GUI tool for intuitive Milvus management. -- [Monitor Milvus with Prometheus](monitor.md). +- [使用 Helm Chart 升级 Milvus](upgrade_milvus_cluster-helm.md)。 +- [扩展您的 Milvus 集群](scaleout.md)。 +- 在云端部署您的 Milvus 集群: +- [Amazon EKS](eks.md) +- [Google Cloud](gcp.md) +- [Microsoft Azure](azure.md) +- 探索 [Milvus Backup](milvus_backup_overview.md),一款用于 Milvus 数据备份的开源工具。 +- 探索 [Birdwatcher](birdwatcher_overview.md),一款用于调试 Milvus 和动态配置更新的开源工具。 +- 探索 [Attu](https://milvus.io/docs/attu.md),一款用于直观 Milvus 管理的开源 GUI 工具。 +- [使用 Prometheus 监控 Milvus](monitor.md)。 diff --git a/site/zh/getstarted/quickstart.md b/site/zh/getstarted/quickstart.md index a07931818..0fc44553d 100644 --- a/site/zh/getstarted/quickstart.md +++ b/site/zh/getstarted/quickstart.md @@ -4,32 +4,33 @@ summary: Get started with Milvus. title: Quickstart --- -# Quickstart with Milvus Lite +# Milvus Lite 快速入门 Open In Colab -Vectors, the output data format of Neural Network models, can effectively encode information and serve a pivotal role in AI applications such as knowledge base, semantic search, Retrieval Augmented Generation (RAG) and more. +向量是神经网络模型的输出数据格式,可以有效地编码信息,并在知识库、语义搜索、增强检索生成(RAG)等 AI 应用中发挥关键作用。 -Milvus is an open-source vector database that suits AI applications of every size from running a demo chatbot in Jupyter notebook to building web-scale search that serves billions of users. In this guide, we will walk you through how to set up Milvus locally within minutes and use the Python client library to generate, store and search vectors. +Milvus 是一个开源向量数据库,适用于各种规模的 AI 应用,从在 Jupyter notebook 中运行演示聊天机器人到构建服务数十亿用户的网络规模搜索。 在本指南中,我们将带您快速设置 Milvus,并使用 Python 客户端库生成、存储和搜索向量。 -## Install Milvus -In this guide we use Milvus Lite, a python library included in `pymilvus` that can be embedded into the client application. Milvus also supports deployment on [Docker](https://milvus.io/docs/install_standalone-docker.md) and [Kubernetes](https://milvus.io/docs/install_cluster-milvusoperator.md) for production use cases. +## 安装 Milvus -Before starting, make sure you have Python 3.8+ available in the local environment. Install `pymilvus` which contains both the python client library and Milvus Lite: +在本指南中,我们使用 Milvus Lite,这是一个包含在 `pymilvus` 中的 Python 库,可以嵌入到客户端应用程序中。 Milvus 还支持在 [Docker](https://milvus.io/docs/install_standalone-docker.md) 和 [Kubernetes](https://milvus.io/docs/install_cluster-milvusoperator.md) 上进行生产使用案例的部署。 +在开始之前,请确保您的本地环境中有 Python 3.8 及以上版本。安装 `pymilvus` 它包含了 Python 客户端库和 Milvus Lite: ```python $ pip install -U pymilvus ``` +
-> If you are using Google Colab, to enable dependencies just installed, you may need to **restart the runtime**. (Click on the "Runtime" menu at the top of the screen, and select "Restart session" from the dropdown menu). +> 如果你正在使用 Google Colab,为了启用刚安装的依赖项,你可能需要 **重启运行时**. (点击屏幕顶部的 "运行时" 菜单,然后从下拉菜单中选择 "重启会话").
-## Set Up Vector Database -To create a local Milvus vector database, simply instantiate a `MilvusClient` by specifying a file name to store all data, such as "milvus_demo.db". +## 设置向量数据库 +要创建一个本地的 Milvus 向量数据库,只需实例化一个 `MilvusClient` 并指定一个文件名来存储所有数据,例如 "milvus_demo.db". ```python from pymilvus import MilvusClient @@ -37,9 +38,9 @@ from pymilvus import MilvusClient client = MilvusClient("milvus_demo.db") ``` -## Create a Collection -In Milvus, we need a collection to store vectors and their associated metadata. You can think of it as a table in traditional SQL databases. When creating a collection, you can define schema and index params to configure vector specs such as dimensionality, index types and distant metrics. There are also complex concepts to optimize the index for vector search performance. For now, let's just focus on the basics and use default for everything possible. At minimum, you only need to set the collection name and the dimension of the vector field of the collection. +## 创建集合 +在 Milvus 中,我们需要一个集合来存储向量及其相关的元数据。 你可以把它看作是传统 SQL 数据库中的一个表。 在创建集合时,你可以定义模式和索引参数,以配置向量规格,如维度、索引类型和距离度量。 还有一些复杂的概念可以优化向量搜索性能的索引。 现在,让我们只关注基础知识,并尽可能使用默认设置。 至少,你只需要设置集合名称和集合中向量字段的维度。 ```python if client.has_collection(collection_name="demo_collection"): @@ -50,25 +51,26 @@ client.create_collection( ) ``` -In the above setup, -- The primary key and vector fields use their default names ("id" and "vector"). -- The metric type (vector distance definition) is set to its default value ([COSINE](https://milvus.io/docs/metric.md#Cosine-Similarity)). -- The primary key field accepts integers and does not automatically increments (namely not using [auto-id feature](https://milvus.io/docs/schema.md)) -Alternatively, you can formally define the schema of the collection by following this [instruction](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_schema.md). +在上述设置中, + +- 主键和向量字段使用默认名称("id" 和 "vector")。 +- 度量类型(向量距离定义)设置为其默认值([余弦](https://milvus.io/docs/metric.md#Cosine-Similarity)). +- 主键字段接受整数,并且不会自动递增(即不使用 [自动 ID 特性](https://milvus.io/docs/schema.md)) + 另外,您可以通过遵循此 [说明正式定义集合的模式](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_schema.md). + +## 准备数据 -## Prepare Data -In this guide, we use vectors to perform semantic search on text. We need to generate vectors for text by downloading embedding models. This can be easily done by using the utility functions from `pymilvus[model]` library. +在本指南中,我们使用向量对文本进行语义搜索。 我们需要通过下载嵌入模型来生成文本的向量。 这可以通过使用 `pymilvus[model]` 库中的实用函数轻松完成。 -## Represent text with vectors -First, install the model library. This package includes essential ML tools such as PyTorch. The package download may take some time if your local environment has never installed PyTorch. +## 用向量表示文本 +首先,安装模型库。 该包包括基本的机器学习工具,如 PyTorch。如果您的本地环境从未安装过 PyTorch,包的下载可能需要一些时间。 ```python $ pip install "pymilvus[model]" ``` -Generate vector embeddings with default model. Milvus expects data to be inserted organized as a list of dictionaries, where each dictionary represents a data record, termed as an entity. - +使用默认模型生成向量嵌入。 Milvus 期望插入的数据以字典列表的形式组织,其中每个字典表示一个数据记录,称为实体。 ```python from pymilvus import model @@ -102,14 +104,15 @@ print("Data has", len(data), "entities, each with fields: ", data[0].keys()) print("Vector dim:", len(data[0]["vector"])) ``` - Dim: 768 (768,) - Data has 3 entities, each with fields: dict_keys(['id', 'vector', 'text', 'subject']) - Vector dim: 768 - +``` +Dim: 768 (768,) +Data has 3 entities, each with fields: dict_keys(['id', 'vector', 'text', 'subject']) +Vector dim: 768 +``` -## [Alternatively] Use fake representation with random vectors -If you couldn't download the model due to network issues, as a walkaround, you can use random vectors to represent the text and still finish the example. Just note that the search result won't reflect semantic similarity as the vectors are fake ones. +## \[或者] 使用随机向量的虚假表示 +If you couldn't download the model due to network issues, as a walkaround, you can use random vectors to represent the text and still finish the example. Just note that the search result won't reflect semantic similarity as the vectors are fake ones. ```python import random @@ -131,13 +134,14 @@ print("Data has", len(data), "entities, each with fields: ", data[0].keys()) print("Vector dim:", len(data[0]["vector"])) ``` - Data has 3 entities, each with fields: dict_keys(['id', 'vector', 'text', 'subject']) - Vector dim: 768 - +``` +Data has 3 entities, each with fields: dict_keys(['id', 'vector', 'text', 'subject']) +Vector dim: 768 +``` ## Insert Data -Let's insert the data into the collection: +Let's insert the data into the collection: ```python res = client.insert(collection_name="demo_collection", data=data) @@ -145,15 +149,17 @@ res = client.insert(collection_name="demo_collection", data=data) print(res) ``` - {'insert_count': 3, 'ids': [0, 1, 2], 'cost': 0} - +``` +{'insert_count': 3, 'ids': [0, 1, 2], 'cost': 0} +``` ## Semantic Search + Now we can do semantic searches by representing the search query text as vector, and conduct vector similarity search on Milvus. ### Vector search -Milvus accepts one or multiple vector search requests at the same time. The value of the query_vectors variable is a list of vectors, where each vector is an array of float numbers. +Milvus accepts one or multiple vector search requests at the same time. The value of the query_vectors variable is a list of vectors, where each vector is an array of float numbers. ```python query_vectors = embedding_fn.encode_queries(["Who is Alan Turing?"]) @@ -170,14 +176,15 @@ res = client.search( print(res) ``` - data: ["[{'id': 2, 'distance': 0.5859944820404053, 'entity': {'text': 'Born in Maida Vale, London, Turing was raised in southern England.', 'subject': 'history'}}, {'id': 1, 'distance': 0.5118255615234375, 'entity': {'text': 'Alan Turing was the first person to conduct substantial research in AI.', 'subject': 'history'}}]"] , extra_info: {'cost': 0} - +``` +data: ["[{'id': 2, 'distance': 0.5859944820404053, 'entity': {'text': 'Born in Maida Vale, London, Turing was raised in southern England.', 'subject': 'history'}}, {'id': 1, 'distance': 0.5118255615234375, 'entity': {'text': 'Alan Turing was the first person to conduct substantial research in AI.', 'subject': 'history'}}]"] , extra_info: {'cost': 0} +``` The output is a list of results, each mapping to a vector search query. Each query contains a list of results, where each result contains the entity primary key, the distance to the query vector, and the entity details with specified `output_fields`. ## Vector Search with Metadata Filtering -You can also conduct vector search while considering the values of the metadata (called "scalar" fields in Milvus, as scalar refers to non-vector data). This is done with a filter expression specifying certain criteria. Let's see how to search and filter with the `subject` field in the following example. +You can also conduct vector search while considering the values of the metadata (called "scalar" fields in Milvus, as scalar refers to non-vector data). This is done with a filter expression specifying certain criteria. Let's see how to search and filter with the `subject` field in the following example. ```python # Insert more docs in another subject. @@ -206,19 +213,20 @@ res = client.search( print(res) ``` - data: ["[{'id': 4, 'distance': 0.27030569314956665, 'entity': {'text': 'Computational synthesis with AI algorithms predicts molecular properties.', 'subject': 'biology'}}, {'id': 3, 'distance': 0.16425910592079163, 'entity': {'text': 'Machine learning has been used for drug design.', 'subject': 'biology'}}]"] , extra_info: {'cost': 0} - +``` +data: ["[{'id': 4, 'distance': 0.27030569314956665, 'entity': {'text': 'Computational synthesis with AI algorithms predicts molecular properties.', 'subject': 'biology'}}, {'id': 3, 'distance': 0.16425910592079163, 'entity': {'text': 'Machine learning has been used for drug design.', 'subject': 'biology'}}]"] , extra_info: {'cost': 0} +``` -By default, the scalar fields are not indexed. If you need to perform metadata filtered search in large dataset, you can consider using fixed schema and also turn on the [index](https://milvus.io/docs/scalar_index.md) to improve the search performance. +By default, the scalar fields are not indexed. If you need to perform metadata filtered search in large dataset, you can consider using fixed schema and also turn on the [index](https://milvus.io/docs/scalar_index.md) to improve the search performance. In addition to vector search, you can also perform other types of searches: ### Query + A query() is an operation that retrieves all entities matching a cretria, such as a [filter expression](https://milvus.io/docs/boolean.md) or matching some ids. For example, retrieving all entities whose scalar field has a particular value: - ```python res = client.query( collection_name="demo_collection", @@ -229,7 +237,6 @@ res = client.query( Directly retrieve entities by primary key: - ```python res = client.query( collection_name="demo_collection", @@ -239,8 +246,8 @@ res = client.query( ``` ## Delete Entities -If you'd like to purge data, you can delete entities specifying the primary key or delete all entities matching a particular filter expression. +If you'd like to purge data, you can delete entities specifying the primary key or delete all entities matching a particular filter expression. ```python # Delete entities by primary key @@ -257,13 +264,14 @@ res = client.delete( print(res) ``` - [0, 2] - [3, 4, 5] - +``` +[0, 2] +[3, 4, 5] +``` ## Load Existing Data -Since all data of Milvus Lite is stored in a local file, you can load all data into memory even after the program terminates, by creating a `MilvusClient` with the existing file. For example, this will recover the collections from "milvus_demo.db" file and continue to write data into it. +Since all data of Milvus Lite is stored in a local file, you can load all data into memory even after the program terminates, by creating a `MilvusClient` with the existing file. For example, this will recover the collections from "milvus_demo.db" file and continue to write data into it. ```python from pymilvus import MilvusClient @@ -272,8 +280,8 @@ client = MilvusClient("milvus_demo.db") ``` ## Drop the collection -If you would like to delete all the data in a collection, you can drop the collection with +If you would like to delete all the data in a collection, you can drop the collection with ```python # Drop collection @@ -281,8 +289,8 @@ client.drop_collection(collection_name="demo_collection") ``` ## Learn More -Milvus Lite is great for getting started with a local python program. If you have large scale data or would like to use Milvus in production, you can learn about deploying Milvus on [Docker](https://milvus.io/docs/install_standalone-docker.md) and [Kubernetes](https://milvus.io/docs/install_cluster-milvusoperator.md). All deployment modes of Milvus share the same API, so your client side code doesn't need to change much if moving to another deployment mode. Simply specify the [URI and Token](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Client/MilvusClient.md) of a Milvus server deployed anywhere: +Milvus Lite is great for getting started with a local python program. If you have large scale data or would like to use Milvus in production, you can learn about deploying Milvus on [Docker](https://milvus.io/docs/install_standalone-docker.md) 和 [Kubernetes](https://milvus.io/docs/install_cluster-milvusoperator.md). All deployment modes of Milvus share the same API, so your client side code doesn't need to change much if moving to another deployment mode. Simply specify the [URI and Token](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Client/MilvusClient.md) of a Milvus server deployed anywhere: ```python client = MilvusClient(uri="http://localhost:19530", token="root:Milvus") diff --git a/site/zh/home/home.md b/site/zh/home/home.md index 43d99e514..593ba2074 100644 --- a/site/zh/home/home.md +++ b/site/zh/home/home.md @@ -5,104 +5,104 @@ id: home.md

- Welcome to Milvus Docs! + 欢迎访问 Milvus 文档!

- Here you will learn about what Milvus is, and how to install, use, and deploy Milvus to build an application according to your business need. + 在这里,你将了解 Milvus 是什么,以及如何安装、使用和部署 Milvus,以根据你的业务需求构建应用程序。

-
+
-

Try Managed Milvus For Free!

-

Try Zilliz Cloud for free! The easiest way to experience Milvus!

+

免費試用 Milvus 管理服務!

免費試用 Zilliz Cloud! +

免费试用 Zilliz Cloud!体验 Milvus 的最简单方式!

- Zilliz Cloud - Zilliz Cloud China + Zilliz云 + 智乐云中国
-## Get Started +## 开始
- icon - + 图标 + -

Learn how to install Milvus using either Docker Compose or on Kubernetes.

-
+

了解如何使用 Docker Compose 或在 Kubernetes 上安装 Milvus。 +

- icon - + 图标 + -

Learn how to quickly run Milvus with sample code.

- +

通过示例代码了解如何快速运行 Milvus。 + - icon + 图标

- Learn how to build vector similarity search applications with Milvus. + 学习如何使用 Milvus 构建矢量相似性搜索应用程序。

- + +
-

Use

+

使用

-- [Manage Collections](manage-collections.md) -- [Insert, Upsert, and Delete](insert-update-delete.md) -- [Index Vector Fields](index-vector-fields.md) -- [Single-Vector Search](single-vector-search.md) -- [Get & Scalar Query](get-and-scalar-query.md) -
+- [管理收藏集](manage-collections.md) +- [插入、更新和删除](insert-update-delete.md) +- [索引向量字段](index-vector-fields.md) +- [单矢量搜索](single-vector-search.md) +- [获取和标量查询](get-and-scalar-query.md) + -

Deploy

+

部署

+- [配置 Milvus](configure-docker.md +- [管理依赖关系](deploy_s3.md) +- [在云上部署](eks.md) +- [扩展 Milvus 集群](scaleout.md) +- [监控和警报](monitor_overview.md) + -

Learn

+

学习

-- [System Configuration](system_configuration.md) -- [Architecture Overview](architecture_overview.md) -- [Vector Index](index.md) -- [Similarity Metrics](metric.md) -- [Glossary](glossary.md) - +- [系统配置](system_configuration.md) +- [架构概述](architecture_overview.md) +- [矢量索引](index.md) +- [相似度度量](metric.md) +- [术语表](glossary.md) + + -## What's new in docs +## 新文档 -_Mar 2024 - Milvus 2.4.0 release_ +_2024年3月 - Milvus 2.4.0 发布_ _Mar 2024 - Milvus 2.4.0 release_ -- Added guidance on how to [conduct hybrid search](multi-vector-search.md). -- Added description of [GPU index](gpu_index.md). -- Added guidance on how to [embed your data using PyMilvus](embeddings.md). -- Added descriptions of [Milvus CDC](milvus-cdc-overview.md). +- 添加了关于如何 [进行混合搜索] 的指导(multi-vector-search.md)。 +- 添加了 [GPU 索引] 的说明(gpu_index.md)。 +- 添加了关于如何 [使用 PyMilvus 嵌入数据] 的指导(embeddings.md)。 +- 添加了 [Milvus CDC](milvus-cdc-overview.md) 的说明。 - + -For quick setup, use the [`create_collection()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_collection.md) method of the [`MilvusClient`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Client/MilvusClient.md) class to create a collection with the specified name and dimension. +要快速设置,请使用 [`create_collection()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_collection.md) 类的方法来创建具有指定名称和维度的集合。 [`MilvusClient`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Client/MilvusClient.md) API 端点用于创建具有指定名称和维度的集合。
-For quick setup, use the [`createCollection()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/createCollection.md) method of the [`MilvusClientV2`](https://milvus.io/api-reference/java/v2.4.x/v2/Client/MilvusClientV2.md) class to create a collection with the specified name and dimension. +要快速设置,请使用 [`createCollection()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/createCollection.md) 类的方法来创建具有指定名称和维度的集合。 [`MilvusClientV2`](https://milvus.io/api-reference/java/v2.4.x/v2/Client/MilvusClientV2.md) API 端点用于创建具有指定名称和维度的集合。
-For quick setup, use the [`createCollection()`](https://milvus.io/api-reference/node/v2.4.x/Collections/createCollection.md) method of the [`MilvusClient`](https://milvus.io/api-reference/node/v2.4.x/Client/MilvusClient.md) class to create a collection with the specified name and dimension. +要快速设置,请使用 [`createCollection()`](https://milvus.io/api-reference/node/v2.4.x/Collections/createCollection.md) 类的方法来创建具有指定名称和维度的集合。 [`MilvusClient`](https://milvus.io/api-reference/node/v2.4.x/Client/MilvusClient.md) API 端点用于创建具有指定名称和维度的集合。
-For quick setup, use the [`POST /v2/vectordb/collections/create`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/Create.md) API endpoint to create a collection with the specified name and dimension. +要快速设置,请使用 [`POST /v2/vectordb/collections/create`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20\(v2\)/Create.md) 上面代码生成的集合仅包含两个字段:
@@ -203,47 +203,47 @@ $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/get_load_state" \ # } ``` -The collection generated in the above code contains only two fields: `id` (as the primary key) and `vector` (as the vector field), with `auto_id` and `enable_dynamic_field` settings enabled by default. +(作为主键) 和 `id` (作为向量字段),并且 `vector` 默认启用设置。 `auto_id` 和 `enable_dynamic_field` 启用此设置可确保主键自动递增。 -- `auto_id` +* `auto_id` - Enabling this setting ensures that the primary key increments automatically. There's no need for manual provision of primary keys during data insertion. + 在数据插入期间无需手动提供主键。 启用时,所有字段(不包括 -- `enable_dynamic_field` +* `enable_dynamic_field` - When enabled, all fields, excluding `id` and `vector` in the data to be inserted, are treated as dynamic fields. These additional fields are saved as key-value pairs within a special field named `$meta`. This feature allows the inclusion of extra fields during data insertion. + 要插入的数据)都被视为动态字段。 `id` 和 `vector` 这些附加字段作为键值对保存在名为 的特殊字段中。 `$meta`. 此功能允许在数据插入期间包含额外字段。 -The automatically indexed and loaded collection from the provided code is ready for immediate data insertions. +从提供的代码自动索引和加载的集合已准备好进行即时数据插入。 -### Customized setup +### 自定义设置 -Instead of letting Milvus decide almost everything for your collection, you can determine the __schema__ and __index parameters__ of the collection on your own. +与其让 Milvus 几乎为您的集合决定一切,不如您自己确定 **模式** 和 **索引参数** 集合的 -#### Step 1: Set up schema +#### 步骤 1:设置模式 -A schema defines the structure of a collection. Within the schema, you have the option to enable or disable `enable_dynamic_field`, add pre-defined fields, and set attributes for each field. For a detailed explanation of the concept and available data types, refer to [Schema Explained](schema.md). +模式定义了集合的结构。 在模式中,您可以选择启用或禁用 `enable_dynamic_field`、添加预定义字段,并为每个字段设置属性。 有关该概念和可用数据类型的详细说明,请参阅 [模式解释](schema.md).
-To set up a schema, use [`create_schema()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_schema.md) to create a schema object and [`add_field()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/CollectionSchema/add_field.md) to add fields to the schema. +要设置模式,请使用 [`create_schema()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_schema.md) 创建模式对象,并 [`add_field()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/CollectionSchema/add_field.md) 向模式添加字段。
-To set up a schema, use [`createSchema()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/createSchema.md) to create a schema object and [`addField()`](https://milvus.io/api-reference/java/v2.4.x/v2/CollectionSchema/addField.md) to add fields to the schema. +要设置模式,请使用 [`createSchema()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/createSchema.md) 创建模式对象,并 [`addField()`](https://milvus.io/api-reference/java/v2.4.x/v2/CollectionSchema/addField.md) 向模式添加字段。
-To set up a schema, use [`createCollection()`](https://milvus.io/api-reference/node/v2.4.x/Collections/createCollection.md). +要设置模式,请使用 [`createCollection()`](https://milvus.io/api-reference/node/v2.4.x/Collections/createCollection.md).
-To set up a schema, you need to define a JSON object that follows the schema format as displayed on the [`POST /v2/vectordb/collections/create`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/Create.md) API endpoint reference page. +要设置模式,您需要定义一个遵循模式格式的 JSON 对象,如在 [`POST /v2/vectordb/collections/create`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20\(v2\)/Create.md) API 端点参考页面。
@@ -453,31 +453,31 @@ export fields='[{ \ -#### Step 2: Set up index parameters +#### 步骤 2:设置索引参数 -Index parameters dictate how Milvus organizes your data within a collection. You can tailor the indexing process for specific fields by adjusting their `metric_type` and `index_type`. For the vector field, you have the flexibility to select `COSINE`, `L2`, `IP`, `HAMMING`, or `JACCARD` as the `metric_type`, depending on the type of vectors you are working with. For more information, refer to [Similarity Metrics](metric.md). +索引参数决定了 Milvus 如何在集合中组织您的数据。 您可以通过调整特定字段来定制索引过程 `metric_type` 和 `index_type`. 对于向量字段,您可以灵活选择 `COSINE`, `L2`, `IP`, `HAMMING`,或 `JACCARD` 作为 `metric_type`,具体取决于您正在处理的向量类型。 有关更多信息,请参阅 [相似性度量](metric.md).
-To set up index parameters, use [`prepare_index_params()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/prepare_index_params.md) to prepare index parameters and [`add_index()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/add_index.md) to add the index. +要设置索引参数,请使用 [`prepare_index_params()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/prepare_index_params.md) 准备索引参数并 [`add_index()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/add_index.md) 添加索引。
-To set up index parameters, use [IndexParam](https://milvus.io/api-reference/java/v2.4.x/v2/Management/IndexParam.md). +要设置索引参数,请使用 [IndexParam](https://milvus.io/api-reference/java/v2.4.x/v2/Management/IndexParam.md).
-To set up index parameters, use [`createIndex()`](https://milvus.io/api-reference/node/v2.4.x/Management/createIndex.md). +要设置索引参数,请使用 [`createIndex()`](https://milvus.io/api-reference/node/v2.4.x/Management/createIndex.md).
-To set up index parameters, you need to define a JSON object that follows the index parameters format as displayed on the [`POST /v2/vectordb/collections/create`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/Create.md) API endpoint reference page. +要设置索引参数,您需要定义一个遵循索引参数格式的 JSON 对象,如下所示 [`POST /v2/vectordb/collections/create`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20\(v2\)/Create.md) API 端点参考页面。
@@ -674,31 +674,31 @@ export indexParams='[{ \ -The code snippet above demonstrates how to set up index parameters for the vector field and a scalar field, respectively. For the vector field, set both the metric type and the index type. For a scalar field, set only the index type. It is recommended to create an index for the vector field and any scalar fields that are frequently used for filtering. +上面的代码片段演示了如何分别为向量字段和标量字段设置索引参数。 对于向量字段,设置度量类型和索引类型。 对于标量字段,仅设置索引类型。 建议为向量字段和任何经常用于过滤的标量字段创建索引。 -#### Step 3: Create the collection +#### 步骤 3:创建集合 -You have the option to create a collection and an index file separately or to create a collection with the index loaded simultaneously upon creation. +您可以选择单独创建集合和索引文件,或在创建时同时创建集合和加载索引。
-Use [create_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_collection.md) to create a collection with the specified schema and index parameters and [get_load_state()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/get_load_state.md) to check the load state of the collection. +使用 [create\_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_collection.md) 创建具有指定模式和索引参数的集合,并且 [get\_load\_state()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/get_load_state.md) 检查集合的加载状态。
-Use [createCollection()](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/createCollection.md) to create a collection with the specified schema and index parameters and [getLoadState()](https://milvus.io/api-reference/java/v2.4.x/v2/Management/getLoadState.md) to check the load state of the collection. +使用 [createCollection()](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/createCollection.md) 创建具有指定模式和索引参数的集合,并且 [getLoadState()](https://milvus.io/api-reference/java/v2.4.x/v2/Management/getLoadState.md) 检查集合的加载状态。
-Use [createCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections/createCollection.md) to create a collection with the specified schema and index parameters and [getLoadState()](https://milvus.io/api-reference/node/v2.4.x/Management/getLoadState.md) to check the load state of the collection. +使用 [createCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections/createCollection.md) 创建具有指定模式和索引参数的集合,并且 [getLoadState()](https://milvus.io/api-reference/node/v2.4.x/Management/getLoadState.md) 检查集合的加载状态。
-- __Create a collection with the index loaded simultaneously upon creation.__ +* **创建一个集合,同时加载索引。**
Python @@ -707,152 +707,152 @@ Use [createCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections cURL
- ```python - # 3.5. Create a collection with the index loaded simultaneously - client.create_collection( - collection_name="customized_setup_1", - schema=schema, - index_params=index_params - ) - - time.sleep(5) - - res = client.get_load_state( - collection_name="customized_setup_1" - ) - - print(res) - - # Output - # - # { - # "state": "" - # } - ``` - - ```java - import io.milvus.v2.service.collection.request.CreateCollectionReq; - import io.milvus.v2.service.collection.request.GetLoadStateReq; - - // 3.4 Create a collection with schema and index parameters - CreateCollectionReq customizedSetupReq1 = CreateCollectionReq.builder() - .collectionName("customized_setup_1") - .collectionSchema(schema) - .indexParams(indexParams) - .build(); - - client.createCollection(customizedSetupReq1); - - // Thread.sleep(5000); - - // 3.5 Get load state of the collection - GetLoadStateReq customSetupLoadStateReq1 = GetLoadStateReq.builder() - .collectionName("customized_setup_1") - .build(); - - res = client.getLoadState(customSetupLoadStateReq1); - - System.out.println(res); - - // Output: - // true - ``` - - ```javascript - // 3.3 Create a collection with fields and index parameters - res = await client.createCollection({ - collection_name: "customized_setup_1", - fields: fields, - index_params: index_params, - }) - - console.log(res.error_code) - - // Output - // - // Success - // - - res = await client.getLoadState({ - collection_name: "customized_setup_1" - }) - - console.log(res.state) - - // Output - // - // LoadStateLoaded - // - ``` - - ```shell - $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/create" \ - -H "Content-Type: application/json" \ - -d '{ - "collectionName": "customized_setup_1", - "schema": { - "autoId": false, - "enabledDynamicField": false, - "fields": [ - { - "fieldName": "my_id", - "dataType": "Int64", - "isPrimary": true - }, - { - "fieldName": "my_vector", - "dataType": "FloatVector", - "elementTypeParams": { - "dim": "5" - } - } - ] - }, - "indexParams": [ - { - "fieldName": "my_vector", - "metricType": "COSINE", - "indexName": "my_vector", - "params": { - "index_type": "IVF_FLAT", - "nlist": "1024" - } - }, - { - "fieldName": "my_id", - "indexName": "my_id", - "params": { - "index_type": "STL_SORT" - } - } - ] - }' - - # Output - # - # { - # "code": 0, - # "data": {}, - # } - - $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/get_load_state" \ - -H "Content-Type: application/json" \ - -d '{ - "collectionName": "customized_setup_1" - }' - - # { - # "code": 0, - # "data": { - # "loadProgress": 100, - # "loadState": "LoadStateLoaded" - # } - # } - ``` - - The collection created above is loaded automatically. To learn more about loading and releasing a collection, refer to [Load & Release Collection](manage-collections.md#Load--Release-Collection). - -- __Create a collection and an index file separately.__ + ```python + # 3.5. Create a collection with the index loaded simultaneously + client.create_collection( + collection_name="customized_setup_1", + schema=schema, + index_params=index_params + ) + + time.sleep(5) + + res = client.get_load_state( + collection_name="customized_setup_1" + ) + + print(res) + + # Output + # + # { + # "state": "" + # } + ``` + + ```java + import io.milvus.v2.service.collection.request.CreateCollectionReq; + import io.milvus.v2.service.collection.request.GetLoadStateReq; + + // 3.4 Create a collection with schema and index parameters + CreateCollectionReq customizedSetupReq1 = CreateCollectionReq.builder() + .collectionName("customized_setup_1") + .collectionSchema(schema) + .indexParams(indexParams) + .build(); + + client.createCollection(customizedSetupReq1); + + // Thread.sleep(5000); + + // 3.5 Get load state of the collection + GetLoadStateReq customSetupLoadStateReq1 = GetLoadStateReq.builder() + .collectionName("customized_setup_1") + .build(); + + res = client.getLoadState(customSetupLoadStateReq1); + + System.out.println(res); + + // Output: + // true + ``` + + ```javascript + // 3.3 Create a collection with fields and index parameters + res = await client.createCollection({ + collection_name: "customized_setup_1", + fields: fields, + index_params: index_params, + }) + + console.log(res.error_code) + + // Output + // + // Success + // + + res = await client.getLoadState({ + collection_name: "customized_setup_1" + }) + + console.log(res.state) + + // Output + // + // LoadStateLoaded + // + ``` + + ```shell + $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/create" \ + -H "Content-Type: application/json" \ + -d '{ + "collectionName": "customized_setup_1", + "schema": { + "autoId": false, + "enabledDynamicField": false, + "fields": [ + { + "fieldName": "my_id", + "dataType": "Int64", + "isPrimary": true + }, + { + "fieldName": "my_vector", + "dataType": "FloatVector", + "elementTypeParams": { + "dim": "5" + } + } + ] + }, + "indexParams": [ + { + "fieldName": "my_vector", + "metricType": "COSINE", + "indexName": "my_vector", + "params": { + "index_type": "IVF_FLAT", + "nlist": "1024" + } + }, + { + "fieldName": "my_id", + "indexName": "my_id", + "params": { + "index_type": "STL_SORT" + } + } + ] + }' + + # Output + # + # { + # "code": 0, + # "data": {}, + # } + + $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/get_load_state" \ + -H "Content-Type: application/json" \ + -d '{ + "collectionName": "customized_setup_1" + }' + + # { + # "code": 0, + # "data": { + # "loadProgress": 100, + # "loadState": "LoadStateLoaded" + # } + # } + ``` + + 上述创建的集合会自动加载。 要了解更多关于加载和释放集合的信息,请参考 [加载与释放集合](manage-collections.md#Load--Release-Collection). + +* **分别创建一个集合和一个索引文件。**
Python @@ -861,110 +861,110 @@ Use [createCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections cURL
- ```python - # 3.6. Create a collection and index it separately - client.create_collection( - collection_name="customized_setup_2", - schema=schema, - ) - - res = client.get_load_state( - collection_name="customized_setup_2" - ) - - print(res) - - # Output - # - # { - # "state": "" - # } - ``` - - ```java - // 3.6 Create a collection and index it separately - CreateCollectionReq customizedSetupReq2 = CreateCollectionReq.builder() - .collectionName("customized_setup_2") - .collectionSchema(schema) - .build(); - - client.createCollection(customizedSetupReq2); - ``` - - ```javascript - // 3.4 Create a collection and index it seperately - res = await client.createCollection({ - collection_name: "customized_setup_2", - fields: fields, - }) - - console.log(res.error_code) - - // Output - // - // Success - // - - res = await client.getLoadState({ - collection_name: "customized_setup_2" - }) - - console.log(res.state) - - // Output - // - // LoadStateNotLoad - // - ``` - - ```shell - $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/create" \ - -H "Content-Type: application/json" \ - -d '{ - "collectionName": "customized_setup_2", - "schema": { - "autoId": false, - "enabledDynamicField": false, - "fields": [ - { - "fieldName": "my_id", - "dataType": "Int64", - "isPrimary": true - }, - { - "fieldName": "my_vector", - "dataType": "FloatVector", - "elementTypeParams": { - "dim": "5" - } - } - ] - - } - }' - - # Output - # - # { - # "code": 0, - # "data": {}, - # } - - $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/get_load_state" \ - -H "Content-Type: application/json" \ - -d '{ - "collectionName": "customized_setup_2" - }' - - # { - # "code": 0, - # "data": { - # "loadState": "LoadStateNotLoaded" - # } - # } - ``` - - The collection created above is not loaded automatically. You can create an index for the collection as follows. Creating an index for the collection in a separate manner does not automatically load the collection. For details, refer to [Load & Release Collection](manage-collections.md#Load--Release-Collection). + ```python + # 3.6. Create a collection and index it separately + client.create_collection( + collection_name="customized_setup_2", + schema=schema, + ) + + res = client.get_load_state( + collection_name="customized_setup_2" + ) + + print(res) + + # Output + # + # { + # "state": "" + # } + ``` + + ```java + // 3.6 Create a collection and index it separately + CreateCollectionReq customizedSetupReq2 = CreateCollectionReq.builder() + .collectionName("customized_setup_2") + .collectionSchema(schema) + .build(); + + client.createCollection(customizedSetupReq2); + ``` + + ```javascript + // 3.4 Create a collection and index it seperately + res = await client.createCollection({ + collection_name: "customized_setup_2", + fields: fields, + }) + + console.log(res.error_code) + + // Output + // + // Success + // + + res = await client.getLoadState({ + collection_name: "customized_setup_2" + }) + + console.log(res.state) + + // Output + // + // LoadStateNotLoad + // + ``` + + ```shell + $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/create" \ + -H "Content-Type: application/json" \ + -d '{ + "collectionName": "customized_setup_2", + "schema": { + "autoId": false, + "enabledDynamicField": false, + "fields": [ + { + "fieldName": "my_id", + "dataType": "Int64", + "isPrimary": true + }, + { + "fieldName": "my_vector", + "dataType": "FloatVector", + "elementTypeParams": { + "dim": "5" + } + } + ] + + } + }' + + # Output + # + # { + # "code": 0, + # "data": {}, + # } + + $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/get_load_state" \ + -H "Content-Type: application/json" \ + -d '{ + "collectionName": "customized_setup_2" + }' + + # { + # "code": 0, + # "data": { + # "loadState": "LoadStateNotLoaded" + # } + # } + ``` + + 上述创建的集合不会自动加载。 您可以按如下方式为集合创建索引。 以单独的方式为集合创建索引不会自动加载集合。有关详细信息,请参考 [加载与释放集合](manage-collections.md#Load--Release-Collection). @@ -1086,7 +1086,7 @@ Use [createCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections
- The collection created above is not loaded automatically. You can create an index for the collection as follows. Creating an index for the collection in a separate manner does not automatically load the collection. For details, refer to [Load & Release Collection](manage-collections.md). + 上述创建的集合不会自动加载。 您可以按如下方式为集合创建索引。 以单独的方式为集合创建索引不会自动加载集合。有关详细信息,请参考 [加载与释放集合](manage-collections.md).
Python @@ -1095,109 +1095,109 @@ Use [createCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections cURL
- ```python - # 3.6 Create index - client.create_index( - collection_name="customized_setup_2", - index_params=index_params - ) - - res = client.get_load_state( - collection_name="customized_setup_2" - ) - - print(res) - - # Output - # - # { - # "state": "" - # } - ``` - - ```java - CreateIndexReq createIndexReq = CreateIndexReq.builder() - .collectionName("customized_setup_2") - .indexParams(indexParams) - .build(); - - client.createIndex(createIndexReq); - - // Thread.sleep(1000); - - // 3.7 Get load state of the collection - GetLoadStateReq customSetupLoadStateReq2 = GetLoadStateReq.builder() - .collectionName("customized_setup_2") - .build(); - - res = client.getLoadState(customSetupLoadStateReq2); - - System.out.println(res); - - // Output: - // false - ``` - - ```javascript - // 3.5 Create index - res = await client.createIndex({ - collection_name: "customized_setup_2", - field_name: "my_vector", - index_type: "IVF_FLAT", - metric_type: "IP", - params: { nlist: 1024} - }) - - res = await client.getLoadState({ - collection_name: "customized_setup_2" - }) - - console.log(res.state) - - // Output - // - // LoadStateNotLoad - // - ``` - - ```shell - $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/indexes/create" \ - -H "Content-Type: application/json" \ - -d '{ - "collectionName": "customized_setup_2", - "indexParams": [ - { - "metricType": "L2", - "fieldName": "my_vector", - "indexName": "my_vector", - "indexConfig": { - "index_type": "IVF_FLAT", - "nlist": "1024" - } - } - ] - }' - - # Output - # - # { - # "code": 0, - # "data": {}, - # } - - $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/get_load_state" \ - -H "Content-Type: application/json" \ - -d '{ - "collectionName": "customized_setup_2" - }' - - # { - # "code": 0, - # "data": { - # "loadState": "LoadStateNotLoaded" - # } - # } - ``` + ```python + # 3.6 Create index + client.create_index( + collection_name="customized_setup_2", + index_params=index_params + ) + + res = client.get_load_state( + collection_name="customized_setup_2" + ) + + print(res) + + # Output + # + # { + # "state": "" + # } + ``` + + ```java + CreateIndexReq createIndexReq = CreateIndexReq.builder() + .collectionName("customized_setup_2") + .indexParams(indexParams) + .build(); + + client.createIndex(createIndexReq); + + // Thread.sleep(1000); + + // 3.7 Get load state of the collection + GetLoadStateReq customSetupLoadStateReq2 = GetLoadStateReq.builder() + .collectionName("customized_setup_2") + .build(); + + res = client.getLoadState(customSetupLoadStateReq2); + + System.out.println(res); + + // Output: + // false + ``` + + ```javascript + // 3.5 Create index + res = await client.createIndex({ + collection_name: "customized_setup_2", + field_name: "my_vector", + index_type: "IVF_FLAT", + metric_type: "IP", + params: { nlist: 1024} + }) + + res = await client.getLoadState({ + collection_name: "customized_setup_2" + }) + + console.log(res.state) + + // Output + // + // LoadStateNotLoad + // + ``` + + ```shell + $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/indexes/create" \ + -H "Content-Type: application/json" \ + -d '{ + "collectionName": "customized_setup_2", + "indexParams": [ + { + "metricType": "L2", + "fieldName": "my_vector", + "indexName": "my_vector", + "indexConfig": { + "index_type": "IVF_FLAT", + "nlist": "1024" + } + } + ] + }' + + # Output + # + # { + # "code": 0, + # "data": {}, + # } + + $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/get_load_state" \ + -H "Content-Type: application/json" \ + -d '{ + "collectionName": "customized_setup_2" + }' + + # { + # "code": 0, + # "data": { + # "loadState": "LoadStateNotLoaded" + # } + # } + ``` @@ -1216,6 +1216,7 @@ Use [createCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections +
An IndexParams object containing a list of IndexParam objects.
@@ -1307,29 +1308,29 @@ Use [createCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections
-## View Collections +## 查看集合
-To check the details of an existing collection, use [describe_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/describe_collection.md). +要检查现有集合的详细信息,请使用 [describe\_collection()](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/describe_collection.md).
-To check the details of an existing collection, use [describeCollection()](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/describeCollection.md). +要检查现有集合的详细信息,请使用 [describeCollection()](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/describeCollection.md).
-To check the details of an existing collection, use [describeCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections/describeCollection.md). +要检查现有集合的详细信息,请使用 [describeCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections/describeCollection.md).
-To view the definition of a collection, you can use the [`POST /v2/vectordb/collections/describe`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/Describe.md) and the [`POST /v2/vectordb/collections/list`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/List.md) API endpoints. +要查看集合的定义,您可以使用 [`POST /v2/vectordb/collections/describe`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20\(v2\)/Describe.md) 和 [`POST /v2/vectordb/collections/list`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20\(v2\)/List.md) API 端点。
@@ -1540,7 +1541,7 @@ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/describe" \ # } ``` -To list all existing collections, you can do as follows: +要列出所有现有集合,您可以按如下方式操作:
Python @@ -1611,36 +1612,36 @@ $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/list" \ # } ``` -## Load & Release Collection +## 加载与释放集合 -During the loading process of a collection, Milvus loads the collection's index file into memory. Conversely, when releasing a collection, Milvus unloads the index file from memory. Before conducting searches in a collection, ensure that the collection is loaded. +在集合的加载过程中,Milvus 会将集合的索引文件加载到内存中。 相反,当释放集合时,Milvus 会从内存中卸载索引文件。 在集合中进行搜索之前,请确保集合已加载。 -### Load a collection +### 加载集合
-To load a collection, use the [`load_collection()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/load_collection.md) method, specifying the collection name. You can also set `replica_number` to determine how many in-memory replicas of data segments to create on query nodes when the collection is loaded. +要加载集合,请使用 [`load_collection()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/load_collection.md) 方法,指定集合名称。您还可以设置 `replica_number` 以确定在加载集合时在查询节点上创建多少个数据段的内存副本。 -- Milvus Standalone: The maximum allowed value for `replica_number` is 1. -- Milvus Cluster: The maximum value should not exceed the `queryNode.replicas` set in your Milvus configurations. For additional details, refer to [Query Node-related Configurations](https://milvus.io/docs/configure_querynode.md#Query-Node-related-Configurations). +* Milvus 独立版:允许的最大值为 `replica_number` 为 1。 +* Milvus 集群:最大值不得超过 `queryNode.replicas` 在您的 Milvus 配置中设置的值。 有关更多详细信息,请参阅 [查询节点相关配置](https://milvus.io/docs/configure_querynode.md#Query-Node-related-Configurations).
-To load a collection, use the [`loadCollection()`](https://milvus.io/api-reference/java/v2.4.x/v2/Management/loadCollection.md) method, specifying the collection name. +要加载集合,请使用 [`loadCollection()`](https://milvus.io/api-reference/java/v2.4.x/v2/Management/loadCollection.md) 方法,指定集合名称。
-To load a collection, use the [`loadCollection()`](https://milvus.io/api-reference/node/v2.4.x/Management/loadCollection.md) method, specifying the collection name. +要加载集合,请使用 [`loadCollection()`](https://milvus.io/api-reference/node/v2.4.x/Management/loadCollection.md) 方法,指定集合名称。
-To load a collection, you can use the [`POST /v2/vectordb/collections/load`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/Load.md) and the [`POST /v2/vectordb/collections/get_load_state`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/GetLoadState.md) API endpoints. +要加载集合,您可以使用 [`POST /v2/vectordb/collections/load`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20\(v2\)/Load.md) 和 [`POST /v2/vectordb/collections/get_load_state`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20\(v2\)/GetLoadState.md) API 端点。
@@ -1752,29 +1753,29 @@ $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/get_load_state" \ # } ``` -### Release a collection +### 释放集合
-To release a collection, use the [`release_collection()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/release_collection.md) method, specifying the collection name. +要释放集合,请使用 [`release_collection()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Management/release_collection.md) 方法,指定集合名称。
-To release a collection, use the [`releaseCollection()`](https://milvus.io/api-reference/java/v2.4.x/v2/Management/releaseCollection.md) method, specifying the collection name. +要释放集合,请使用 [`releaseCollection()`](https://milvus.io/api-reference/java/v2.4.x/v2/Management/releaseCollection.md) 方法,指定集合名称。
-To release a collection, use the [`releaseCollection()`](https://milvus.io/api-reference/node/v2.4.x/Management/releaseCollection.md) method, specifying the collection name. +要释放集合,请使用 [`releaseCollection()`](https://milvus.io/api-reference/node/v2.4.x/Management/releaseCollection.md) 方法,指定集合名称。
-To release a collection, you can use the [`POST /v2/vectordb/collections/release`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/Release.md) and the [`POST /v2/vectordb/collections/get_load_state`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/GetLoadState.md) API endpoints. +要释放集合,您可以使用 [`POST /v2/vectordb/collections/release`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20\(v2\)/Release.md) 和 [`POST /v2/vectordb/collections/get_load_state`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20\(v2\)/GetLoadState.md) API 端点。
@@ -1879,33 +1880,33 @@ $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/get_load_state" \ # } ``` -## Set up aliases +## 设置别名 -You can assign aliases for collections to make them more meaningful in a specific context. You can assign multiple aliases for a collection, but multiple collections cannot share an alias. +您可以为集合分配别名,以使其在特定上下文中更具意义。 您可以为一个集合分配多个别名,但多个集合不能共享一个别名。 -### Create aliases +### 创建别名
-To create aliases, use the [`create_alias()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_alias.md) method, specifying the collection name and the alias. +要创建别名,请使用 [`create_alias()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/create_alias.md) 方法,指定集合名称和别名。
-To create aliases, use the [`createAlias()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/createAlias.md) method, specifying the collection name and the alias. +要创建别名,请使用 [`createAlias()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/createAlias.md) 方法,指定集合名称和别名。
-To create aliases, use the [`createAlias()`](https://milvus.io/api-reference/node/v2.4.x/Collections/createAlias.md) method, specifying the collection name and the alias. +要创建别名,请使用 [`createAlias()`](https://milvus.io/api-reference/node/v2.4.x/Collections/createAlias.md) 方法,指定集合名称和别名。
-To create aliases for a collection, you can use the [`POST /v2/vectordb/aliases/create`](https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20(v2)/Create.md) API endpoint. +To create aliases for a collection, you can use the [`POST /v2/vectordb/aliases/create`](https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20\(v2\)/Create.md) API endpoint.
@@ -2088,25 +2089,25 @@ $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/aliases/create" \
-To list aliases, use the [`list_aliases()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/list_aliases.md) method, specifying the collection name. +To list aliases, use the [`list_aliases()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/list_aliases.md) 方法,指定集合名称。
-To list aliases, use the [`listAliases()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/listAliases.md) method, specifying the collection name. +To list aliases, use the [`listAliases()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/listAliases.md) 方法,指定集合名称。
-To list aliases, use the [`listAliases()`](https://milvus.io/api-reference/node/v2.4.x/Collections/listAliases.md) method, specifying the collection name. +To list aliases, use the [`listAliases()`](https://milvus.io/api-reference/node/v2.4.x/Collections/listAliases.md) 方法,指定集合名称。
-To list aliases for a collection, you can use the [`POST /v2/vectordb/aliases/list`](https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20(v2)/List.md) API endpoint. +To list aliases for a collection, you can use the [`POST /v2/vectordb/aliases/list`](https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20\(v2\)/List.md) API endpoint.
@@ -2209,7 +2210,7 @@ To describe aliases, use the [`describeAlias()`](https://milvus.io/api-reference
-To describe aliases for a collection, you can use the [`POST /v2/vectordb/aliases/describe`](https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20(v2)/Describe.md) API endpoint. +To describe aliases for a collection, you can use the [`POST /v2/vectordb/aliases/describe`](https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20\(v2\)/Describe.md) API endpoint.
@@ -2305,25 +2306,25 @@ $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/aliases/describe" \
-To reassign aliases to other collections, use the [`alter_alias()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/alter_alias.md) method, specifying the collection name and the alias. +To reassign aliases to other collections, use the [`alter_alias()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/alter_alias.md) 方法,指定集合名称和别名。
-To reassign aliases to other collections, use the [`alterAlias()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/alterAlias.md) method, specifying the collection name and the alias. +To reassign aliases to other collections, use the [`alterAlias()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/alterAlias.md) 方法,指定集合名称和别名。
-To reassign aliases to other collections, use the [`alterAlias()`](https://milvus.io/api-reference/node/v2.4.x/Collections/alterAlias.md) method, specifying the collection name and the alias. +To reassign aliases to other collections, use the [`alterAlias()`](https://milvus.io/api-reference/node/v2.4.x/Collections/alterAlias.md) 方法,指定集合名称和别名。
-To reassign aliases to other collections, you can use the [`POST /v2/vectordb/aliases/alter`](https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20(v2)/Alter.md) API endpoint. +To reassign aliases to other collections, you can use the [`POST /v2/vectordb/aliases/alter`](https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20\(v2\)/Alter.md) API endpoint.
@@ -2511,7 +2512,7 @@ To drop aliases, use the [`dropAlias()`](https://milvus.io/api-reference/node/v2
-To drop aliases for a collection, you can use the [`POST /v2/vectordb/aliases/drop`](https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20(v2)/Drop.md) API endpoint. +To drop aliases for a collection, you can use the [`POST /v2/vectordb/aliases/drop`](https://milvus.io/api-reference/restful/v2.4.x/v2/Alias%20\(v2\)/Drop.md) API endpoint.
@@ -2573,6 +2574,7 @@ console.log(res.error_code) // Success // ``` + ```shell $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/aliases/drop" \ -H "Content-Type: application/json" \ @@ -2601,7 +2603,7 @@ $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/aliases/drop" \ ## Set Properties -You can set properties for a collection, such as `ttl.seconds` and `mmap.enabled`. For more information, refer to [set_properties()](https://milvus.io/api-reference/pymilvus/v2.4.x/ORM/Collection/set_properties.md). +You can set properties for a collection, such as `ttl.seconds` 和 `mmap.enabled`. For more information, refer to [set\_properties()](https://milvus.io/api-reference/pymilvus/v2.4.x/ORM/Collection/set_properties.md).
@@ -2667,25 +2669,25 @@ If a collection is no longer needed, you can drop the collection.
-To drop a collection, use the [`drop_collection()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/drop_collection.md) method, specifying the collection name. +To drop a collection, use the [`drop_collection()`](https://milvus.io/api-reference/pymilvus/v2.4.x/MilvusClient/Collections/drop_collection.md) 方法,指定集合名称。
-To drop a collection, use the [`dropCollection()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/dropCollection.md) method, specifying the collection name. +To drop a collection, use the [`dropCollection()`](https://milvus.io/api-reference/java/v2.4.x/v2/Collections/dropCollection.md) 方法,指定集合名称。
-To drop a collection, use the [`dropCollection()`](https://milvus.io/api-reference/node/v2.4.x/Collections/dropCollection.md) method, specifying the collection name. +To drop a collection, use the [`dropCollection()`](https://milvus.io/api-reference/node/v2.4.x/Collections/dropCollection.md) 方法,指定集合名称。
-To drop a collection, you can use the [`POST /v2/vectordb/collections/drop`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20(v2)/Drop.md) API endpoint. +To drop a collection, you can use the [`POST /v2/vectordb/collections/drop`](https://milvus.io/api-reference/restful/v2.4.x/v2/Collection%20\(v2\)/Drop.md) API endpoint.
@@ -2809,4 +2811,3 @@ $ curl -X POST "http://${MILVUS_URI}/v2/vectordb/collections/drop" \ # "data": {} # } ``` -