@@ -84,15 +83,15 @@ All tests are performed under the following environments.
### Software environment
-| Software | Version |
-| ------------- | --------------------------------------------------------------------- |
-| Milvus | v2.2.0 |
-| Milvus GO SDK | v2.2.0 |
+| Software | Version |
+| ------------- | ------- |
+| Milvus | v2.2.0 |
+| Milvus GO SDK | v2.2.0 |
### Deployment scheme
- Milvus instances (standalone or cluster) are deployed via [Helm](https://milvus.io/docs/install_standalone-helm.md) on a Kubernetes cluster based on physical or virtual machines.
-- Different tests merely vary in the number of CPU cores, the size of memory, and the number of replicas (worker nodes), which only applies to Milvus clusters.
+- Different tests merely vary in the number of CPU cores, the size of memory, and the number of replicas (worker nodes), which only applies to Milvus clusters.
- Unspecified configurations are identical to [default configurations](https://github.com/milvus-io/milvus-helm/blob/master/charts/milvus/values.yaml).
- Milvus dependencies (MinIO, Pulsar and Etcd) store data on the local SSD in each node.
- Search requests are sent to the Milvus instances via [Milvus GO SDK](https://github.com/milvus-io/milvus-sdk-go/tree/master/tests).
@@ -112,31 +111,29 @@ The test uses the open-source dataset SIFT (128 dimensions) from [ANN-Benchmarks
## Test results
-### Milvus 2.2.0 v.s. Milvus 2.1.0
+### Milvus 2.2.0 v.s. Milvus 2.1.0
#### Cluster
Server configurations (cluster)
-
-```yaml
-queryNode:
- replicas: 1
- resources:
- limits:
- cpu: "12.0"
- memory: 8Gi
- requests:
- cpu: "12.0"
- memory: 8Gi
-```
-
+ ```yaml
+ queryNode:
+ replicas: 1
+ resources:
+ limits:
+ cpu: "12.0"
+ memory: 8Gi
+ requests:
+ cpu: "12.0"
+ memory: 8Gi
+ ```
**Search performance**
| Milvus | QPS | RT(TP99) / ms | RT(TP50) / ms | fail/s |
-| ------ |------ |---------------|---------------|--------|
+| ------ | ----- | ------------- | ------------- | ------ |
| 2.1.0 | 6904 | 59 | 28 | 0 |
| 2.2.0 | 10248 | 63 | 24 | 0 |
@@ -146,27 +143,25 @@ queryNode:
Server configurations (standalone)
-
-```yaml
-standalone:
- replicas: 1
- resources:
- limits:
- cpu: "12.0"
- memory: 16Gi
- requests:
- cpu: "12.0"
- memory: 16Gi
-```
-
+ ```yaml
+ standalone:
+ replicas: 1
+ resources:
+ limits:
+ cpu: "12.0"
+ memory: 16Gi
+ requests:
+ cpu: "12.0"
+ memory: 16Gi
+ ```
**Search performance**
-| Milvus | QPS | RT(TP99) / ms | RT(TP50) / ms | fail/s |
-|------ |------|--------------- |---------------|--------|
-| 2.1.0 | 4287 | 104 | 76 | 0 |
-| 2.2.0 | 7522 | 127 | 79 | 0 |
+| Milvus | QPS | RT(TP99) / ms | RT(TP50) / ms | fail/s |
+| ------ | ---- | ------------- | ------------- | ------ |
+| 2.1.0 | 4287 | 104 | 76 | 0 |
+| 2.2.0 | 7522 | 127 | 79 | 0 |
![Standalone search performance](../../../assets/standalone_search_performance_210_vs_220.png)
@@ -176,29 +171,27 @@ Expand the CPU cores in one Querynode to check the capability to scale up.
Server configurations (cluster)
-
- ```yaml
-queryNode:
- replicas: 1
- resources:
- limits:
- cpu: "8.0" /"12.0" /"16.0" /"32.0"
- memory: 8Gi
- requests:
- cpu: "8.0" /"12.0" /"16.0" /"32.0"
- memory: 8Gi
-```
-
+ ```yaml
+ queryNode:
+ replicas: 1
+ resources:
+ limits:
+ cpu: "8.0" /"12.0" /"16.0" /"32.0"
+ memory: 8Gi
+ requests:
+ cpu: "8.0" /"12.0" /"16.0" /"32.0"
+ memory: 8Gi
+ ```
**Search Performance**
-| CPU cores | Concurrent Number | QPS | RT(TP99) / ms | RT(TP50) / ms | fail/s |
-| ------|------|------|---------------|---------------|--------|
-| 8 | 500 | 7153 | 127 | 83 | 0 |
-| 12 | 300 | 10248 | 63 | 24 | 0 |
-| 16 | 600 | 14135 | 85 | 42 | 0 |
-| 32 | 600 | 20281 | 63 | 28 | 0 |
+| CPU cores | Concurrent Number | QPS | RT(TP99) / ms | RT(TP50) / ms | fail/s |
+| --------- | ----------------- | ----- | ------------- | ------------- | ------ |
+| 8 | 500 | 7153 | 127 | 83 | 0 |
+| 12 | 300 | 10248 | 63 | 24 | 0 |
+| 16 | 600 | 14135 | 85 | 42 | 0 |
+| 32 | 600 | 20281 | 63 | 28 | 0 |
![Search performance by Querynode CPU cores](../../../assets/search_performance_by_querynode_cpu_cores.png)
@@ -214,28 +207,25 @@ Note: the number of Querynodes equals the `replica_number` when loading the coll
Server configurations (cluster)
-
-```yaml
-queryNode:
- replicas: 1 / 2 / 4 / 8
- resources:
- limits:
- cpu: "8.0"
- memory: 8Gi
- requests:
- cpu: "8.0"
- memory: 8Gi
-```
-
+ ```yaml
+ queryNode:
+ replicas: 1 / 2 / 4 / 8
+ resources:
+ limits:
+ cpu: "8.0"
+ memory: 8Gi
+ requests:
+ cpu: "8.0"
+ memory: 8Gi
+ ```
-
-| Replicas | Concurrent Number | QPS | RT(TP99) / ms | RT(TP50) / ms | fail/s |
-|------|------|------|---------------|---------------|--------|
-| 1 | 500 | 7153 | 127 | 83 | 0 |
-| 2 | 500 | 15903 | 105 | 27 | 0 |
-| 4 | 800 | 19281 | 109 | 40 | 0 |
-| 8 | 1200 | 30655 | 93 | 38 | 0 |
+| Replicas | Concurrent Number | QPS | RT(TP99) / ms | RT(TP50) / ms | fail/s |
+| -------- | ----------------- | ----- | ------------- | ------------- | ------ |
+| 1 | 500 | 7153 | 127 | 83 | 0 |
+| 2 | 500 | 15903 | 105 | 27 | 0 |
+| 4 | 800 | 19281 | 109 | 40 | 0 |
+| 8 | 1200 | 30655 | 93 | 38 | 0 |
![Search performance by Querynode replicas](../../../assets/search_performance_by_querynode_replicas.png)
diff --git a/site/en/reference/disk_index.md b/site/en/reference/disk_index.md
index 6e1aa1a36..746c10762 100644
--- a/site/en/reference/disk_index.md
+++ b/site/en/reference/disk_index.md
@@ -61,10 +61,10 @@ DiskIndex:
| Parameter | Description | Value Range | Default Value |
| --- | --- | --- | --- |
-| `MaxDegree` | Maximum degree of the Vamana graph.
A larger value offers a higher recall rate but increases the size of and time to build the index. | [1, 512] | 56 |
-| `SearchListSize` | Size of the candidate list.
A larger value increases the time spent on building the index but offers a higher recall rate.
Set it to a value smaller than `MaxDegree` unless you need to reduce the index-building time. | [1, int32_max] | 100 |
-| `PQCodeBugetGBRatio` | Size limit on the PQ code.
A larger value offers a higher recall rate but increases memory usage. | (0.0, 0.25] | 0.125 |
-| `SearchCacheBudgetGBRatio` | Ratio of cached node numbers to raw data.
A larger value improves index-building performance with increased memory usage. | [0.0, 0.3) | 0.10 |
+| `MaxDegree` | Maximum degree of the Vamana graph.
A larger value offers a higher recall rate but increases the size of and time to build the index. | [1, 512] | 56 |
+| `SearchListSize` | Size of the candidate list.
A larger value increases the time spent on building the index but offers a higher recall rate.
Set it to a value smaller than `MaxDegree` unless you need to reduce the index-building time. | [1, int32_max] | 100 |
+| `PQCodeBugetGBRatio` | Size limit on the PQ code.
A larger value offers a higher recall rate but increases memory usage. | (0.0, 0.25] | 0.125 |
+| `SearchCacheBudgetGBRatio` | Ratio of cached node numbers to raw data.
A larger value improves index-building performance with increased memory usage. | [0.0, 0.3) | 0.10 |
| `BeamWidthRatio` | Ratio between the maximum number of IO requests per search iteration and CPU number. | [1, max(128 / CPU number, 16)] | 4.0 |
## Troubleshooting
diff --git a/site/en/userGuide/manage-collections.md b/site/en/userGuide/manage-collections.md
index 6af8c27c2..54414853a 100644
--- a/site/en/userGuide/manage-collections.md
+++ b/site/en/userGuide/manage-collections.md
@@ -335,11 +335,11 @@ export fields='[{ \
auto_id |
- Determines if the primary field automatically increments. Setting this to True makes the primary field automatically increment. In this case, the primary field should not be included in the data to insert to avoid errors. The auto-generated IDs have a fixed length and cannot be altered. |
+ Determines if the primary field automatically increments. Setting this to True makes the primary field automatically increment. In this case, the primary field should not be included in the data to insert to avoid errors. The auto-generated IDs have a fixed length and cannot be altered. |
enable_dynamic_field |
- Determines if Milvus saves the values of undefined fields in a dynamic field if the data being inserted into the target collection includes fields that are not defined in the collection's schema. When you set this to True, Milvus will create a field called $meta to store any undefined fields and their values from the data that is inserted. |
+ Determines if Milvus saves the values of undefined fields in a dynamic field if the data being inserted into the target collection includes fields that are not defined in the collection's schema. When you set this to True, Milvus will create a field called $meta to store any undefined fields and their values from the data that is inserted. |
field_name |
@@ -351,11 +351,11 @@ export fields='[{ \
is_primary |
- Whether the current field is the primary field in a collection. Each collection has only one primary field. A primary field should be of either the DataType.INT64 type or the DataType.VARCHAR type. |
+ Whether the current field is the primary field in a collection. Each collection has only one primary field. A primary field should be of either the DataType.INT64 type or the DataType.VARCHAR type. |
dim |
- The dimension of the vector embeddings. This is mandatory for a field of the DataType.FLOAT_VECTOR, DataType.BINARY_VECTOR, DataType.FLOAT16_VECTOR, or DataType.BFLOAT16_VECTOR type. If you use DataType.SPARSE_FLOAT_VECTOR, omit this parameter. |
+ The dimension of the vector embeddings. This is mandatory for a field of the DataType.FLOAT_VECTOR, DataType.BINARY_VECTOR, DataType.FLOAT16_VECTOR, or DataType.BFLOAT16_VECTOR type. If you use DataType.SPARSE_FLOAT_VECTOR, omit this parameter. |
@@ -378,15 +378,15 @@ export fields='[{ \
isPrimaryKey |
- Whether the current field is the primary field in a collection. Each collection has only one primary field. A primary field should be of either the DataType.Int64 type or the DataType.VarChar type. |
+ Whether the current field is the primary field in a collection. Each collection has only one primary field. A primary field should be of either the DataType.Int64 type or the DataType.VarChar type. |
autoID |
- Whether allows the primary field to automatically increment. Setting this to true makes the primary field automatically increment. In this case, the primary field should not be included in the data to insert to avoid errors. |
+ Whether allows the primary field to automatically increment. Setting this to true makes the primary field automatically increment. In this case, the primary field should not be included in the data to insert to avoid errors. |
dimension |
- The dimension of the vector embeddings. This is mandatory for a field of the DataType.FloatVector, DataType.BinaryVector, DataType.Float16Vector, or DataType.BFloat16Vector type. |
+ The dimension of the vector embeddings. This is mandatory for a field of the DataType.FloatVector, DataType.BinaryVector, DataType.Float16Vector, or DataType.BFloat16Vector type. |
@@ -409,15 +409,15 @@ export fields='[{ \
is_primary_key |
- Whether the current field is the primary field in a collection. Each collection has only one primary field. A primary field should be of either the DataType.INT64 type or the DataType.VARCHAR type. |
+ Whether the current field is the primary field in a collection. Each collection has only one primary field. A primary field should be of either the DataType.INT64 type or the DataType.VARCHAR type. |
auto_id |
- Whether the primary field automatically increments upon data insertions into this collection. The value defaults to False. Setting this to True makes the primary field automatically increment. Skip this parameter if you need to set up a collection with a customized schema. |
+ Whether the primary field automatically increments upon data insertions into this collection. The value defaults to False. Setting this to True makes the primary field automatically increment. Skip this parameter if you need to set up a collection with a customized schema. |
dim |
- The dimensionality of the collection field that holds vector embeddings. The value should be an integer greater than 1 and is usually determined by the model you use to generate vector embeddings. |
+ The dimensionality of the collection field that holds vector embeddings. The value should be an integer greater than 1 and is usually determined by the model you use to generate vector embeddings. |
@@ -980,11 +980,11 @@ Use [createCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections
schema |
- The schema of this collection. Setting this to None indicates this collection will be created with default settings. To set up a collection with a customized schema, you need to create a CollectionSchema object and reference it here. In this case, Milvus ignores all other schema-related settings carried in the request. |
+ The schema of this collection. Setting this to None indicates this collection will be created with default settings. To set up a collection with a customized schema, you need to create a CollectionSchema object and reference it here. In this case, Milvus ignores all other schema-related settings carried in the request. |
index_params |
- The parameters for building the index on the vector field in this collection. To set up a collection with a customized schema and automatically load the collection to memory, you need to create an IndexParams object and reference it here. You should at least add an index for the vector field in this collection. You can also skip this parameter if you prefer to set up the index parameters later on. |
+ The parameters for building the index on the vector field in this collection. To set up a collection with a customized schema and automatically load the collection to memory, you need to create an IndexParams object and reference it here. You should at least add an index for the vector field in this collection. You can also skip this parameter if you prefer to set up the index parameters later on. |
@@ -1003,7 +1003,7 @@ Use [createCollection()](https://milvus.io/api-reference/node/v2.4.x/Collections
collectionSchema |
- The schema of this collection. Leaving it empty indicates this collection will be created with default settings. To set up a collection with a customized schema, you need to create a CollectionSchema object and reference it here. |
+ The schema of this collection. Leaving it empty indicates this collection will be created with default settings. To set up a collection with a customized schema, you need to create a CollectionSchema object and reference it here. |
indexParams |
diff --git a/site/en/userGuide/manage_databases.md b/site/en/userGuide/manage_databases.md
index 123e376b7..489acb5d3 100644
--- a/site/en/userGuide/manage_databases.md
+++ b/site/en/userGuide/manage_databases.md
@@ -35,8 +35,8 @@ Use [MilvusClient](https://milvus.io/api-reference/node/v2.4.x/Client/MilvusClie
```python
@@ -69,17 +69,17 @@ R response = client.createDatabase(createDatabaseParam);
```
```javascript
-const address = "http://localhost:19530"
+const address = "http://localhost:19530";
// 1. Set up a Milvus Client
-client = new MilvusClient({address});
+client = new MilvusClient({ address });
// 3. Create a database
res = await client.createDatabase({
- db_name: "my_database"
-})
+ db_name: "my_database",
+});
-console.log(res)
+console.log(res);
// {
// error_code: 'Success',
@@ -115,10 +115,10 @@ db.using_database("my_database")
```javascript
// 4. Activate another database
res = await client.useDatabase({
- db_name: "my_database"
-})
+ db_name: "my_database",
+});
-console.log(res)
+console.log(res);
```
You can also set a database to use upon connecting to your Milvus cluster as follows:
@@ -152,7 +152,7 @@ const address = "http://localhost:19530";
const db_name = "my_database";
// 1. Set up a Milvus Client
-client = new MilvusClient({address, db_name});
+client = new MilvusClient({ address, db_name });
```
## List databases
@@ -205,9 +205,9 @@ System.out.println(listDatabasesResponse.getData());
```
```javascript
-res = await client.listDatabases()
+res = await client.listDatabases();
-console.log(res.db_names)
+console.log(res.db_names);
// [ 'default', 'my_database' ]
```
@@ -261,8 +261,8 @@ response = client.dropDatabase(dropDatabaseParam);
```javascript
res = await client.dropDatabase({
- db_name: "my_database"
-})
+ db_name: "my_database",
+});
```
## Use RBAC with database
@@ -328,14 +328,14 @@ public class ConnectToMilvus {
const address = "http://localhost:19530";
const token = "root:Milvus";
-function connectToMilvus(dbName="default") {
- const client = new MilvusClient({
- address,
- token,
- dbName
- });
+function connectToMilvus(dbName = "default") {
+ const client = new MilvusClient({
+ address,
+ token,
+ dbName,
+ });
- return client;
+ return client;
}
```
@@ -347,116 +347,114 @@ function connectToMilvus(dbName="default") {
Node.js
- ```python
- _ROLE_NAME = "test_role"
- _PRIVILEGE_INSERT = "Insert"
-
- connect_to_milvus()
- role = Role(_ROLE_NAME)
- role.create()
-
- connect_to_milvus()
- role.grant("Collection", "*", _PRIVILEGE_INSERT)
- print(role.list_grants())
- print(role.list_grant("Collection", "*"))
- role.revoke("Global", "*", _PRIVILEGE_INSERT)
- ```
-
- ```java
- String ROLE_NAME = "test_role";
- String PRIVILEGE_INSERT = "Insert";
-
- MilvusServiceClient client = new ConnectToMilvus().build();
- R response = client.createRole(CreateRoleParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .build());
-
- if (response.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(response.getMessage());
- }
-
- response = client.grantRolePrivilege(GrantRolePriviledgeParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withObject("Collection")
- .withObjectName("*")
- .withPrivilege(PRIVILEGE_INSERT)
- .build());
-
- if (response.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(response.getMessage());
- }
-
- R grants = client.selectGrantForRole(SelectGrantForRoleParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .build());
-
- if (grants.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(grants.getMessage());
- }
-
- System.out.println(grants.getData());
-
- grants = client.selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withObject("Collection")
- .withObjectName("*")
- .build());
-
- if (grants.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(grants.getMessage());
- }
-
- System.out.println(grants.getData());
-
- response = client.revokeRolePrivilege(RevokeRolePrivilegeParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withObject("Global")
- .withObjectName("*")
- .withPrivilege(PRIVILEGE_INSERT)
- .build());
-
- if (response.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(response.getMessage());
- }
-
- response = client.revokeRolePrivilege(RevokeRolePrivilegeParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withObject("Global")
- .withObjectName("*")
- .withPrivilege(PRIVILEGE_INSERT)
- .build());
-
- if (response.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(response.getMessage());
- }
- ```
-
- ```javascript
- const ROLE_NAME = "test_role";
- const PRIVILEGE_INSERT = "Insert";
-
- const client = connectToMilvus();
-
- async function demo() {
-
- }
- await client.createRole({
- roleName: ROLE_NAME
- })
-
- const grants = await client.listGrants({
- roleName: ROLE_NAME
- })
-
- console.log(grants.grants);
-
- await client.revokePrivilege({
- roleName: ROLE_NAME,
- object: "Global",
- objectName: "*",
- privilege: PRIVILEGE_INSERT
- })
- ```
+ ```python
+ _ROLE_NAME = "test_role"
+ _PRIVILEGE_INSERT = "Insert"
+
+ connect_to_milvus()
+ role = Role(_ROLE_NAME)
+ role.create()
+
+ connect_to_milvus()
+ role.grant("Collection", "*", _PRIVILEGE_INSERT)
+ print(role.list_grants())
+ print(role.list_grant("Collection", "*"))
+ role.revoke("Global", "*", _PRIVILEGE_INSERT)
+ ```
+
+ ```java
+ String ROLE_NAME = "test_role";
+ String PRIVILEGE_INSERT = "Insert";
+
+ MilvusServiceClient client = new ConnectToMilvus().build();
+ R response = client.createRole(CreateRoleParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .build());
+
+ if (response.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(response.getMessage());
+ }
+
+ response = client.grantRolePrivilege(GrantRolePriviledgeParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withObject("Collection")
+ .withObjectName("*")
+ .withPrivilege(PRIVILEGE_INSERT)
+ .build());
+
+ if (response.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(response.getMessage());
+ }
+
+ R grants = client.selectGrantForRole(SelectGrantForRoleParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .build());
+
+ if (grants.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(grants.getMessage());
+ }
+
+ System.out.println(grants.getData());
+
+ grants = client.selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withObject("Collection")
+ .withObjectName("*")
+ .build());
+
+ if (grants.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(grants.getMessage());
+ }
+
+ System.out.println(grants.getData());
+
+ response = client.revokeRolePrivilege(RevokeRolePrivilegeParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withObject("Global")
+ .withObjectName("*")
+ .withPrivilege(PRIVILEGE_INSERT)
+ .build());
+
+ if (response.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(response.getMessage());
+ }
+
+ response = client.revokeRolePrivilege(RevokeRolePrivilegeParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withObject("Global")
+ .withObjectName("*")
+ .withPrivilege(PRIVILEGE_INSERT)
+ .build());
+
+ if (response.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(response.getMessage());
+ }
+ ```
+
+ ```javascript
+ const ROLE_NAME = "test_role";
+ const PRIVILEGE_INSERT = "Insert";
+
+ const client = connectToMilvus();
+
+ async function demo() {}
+ await client.createRole({
+ roleName: ROLE_NAME,
+ });
+
+ const grants = await client.listGrants({
+ roleName: ROLE_NAME,
+ });
+
+ console.log(grants.grants);
+
+ await client.revokePrivilege({
+ roleName: ROLE_NAME,
+ object: "Global",
+ objectName: "*",
+ privilege: PRIVILEGE_INSERT,
+ });
+ ```
- If a Milvus connection specifies a `db_name`, but a Permission API call afterward does not, **database** refers to the database whose name was specified in the Milvus connection.
@@ -466,92 +464,90 @@ function connectToMilvus(dbName="default") {
Node.js
- ```python
- # NOTE: please make sure the 'foo' db has been created
- connect_to_milvus(db_name="foo")
-
- # This role will have the insert permission of all collections under foo db,
- # excluding the insert permissions of collections under other dbs
- role.grant("Collection", "*", _PRIVILEGE_INSERT)
- print(role.list_grants())
- print(role.list_grant("Collection", "*"))
- role.revoke("Global", "*", _PRIVILEGE_INSERT)
- ```
-
- ```java
- // NOTE: please make sure the 'foo' db has been created
- MilvusServiceClient client = new ConnectToMilvus().withDbName("foo").build();
-
- // This role will have the insert permission of all collections under foo db,
- // excluding the insert permissions of collections under other dbs
- R response = client.grantRolePrivilege(GrantRolePriviledgeParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withObject("Collection")
- .withObjectName("*")
- .withPrivilege(PRIVILEGE_INSERT)
- .build());
-
- if (response.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(response.getMessage());
- }
-
- R grants = client.selectGrantForRole(SelectGrantForRoleParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .build());
-
- if (grants.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(grants.getMessage());
- }
-
- System.out.println(grants.getData());
-
- grants = client.selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withObject("Collection")
- .withObjectName("*")
- .build());
-
- if (grants.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(grants.getMessage());
- }
-
- System.out.println(grants.getData());
-
- response = client.revokeRolePrivilege(RevokeRolePrivilegeParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withObject("Global")
- .withObjectName("*")
- .withPrivilege(PRIVILEGE_INSERT)
- .build());
-
- if (response.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(response.getMessage());
- }
- ```
-
- ```javascript
- const client = connectToMilvus("foo");
-
- async function demo() {
-
- }
- await client.createRole({
- roleName: ROLE_NAME
- })
-
- const grants = await client.listGrants({
- roleName: ROLE_NAME
- })
-
- console.log(grants.grants);
-
- await client.revokePrivilege({
- roleName: ROLE_NAME,
- object: "Global",
- objectName: "*",
- privilege: PRIVILEGE_INSERT
- })
- ```
+ ```python
+ # NOTE: please make sure the 'foo' db has been created
+ connect_to_milvus(db_name="foo")
+
+ # This role will have the insert permission of all collections under foo db,
+ # excluding the insert permissions of collections under other dbs
+ role.grant("Collection", "*", _PRIVILEGE_INSERT)
+ print(role.list_grants())
+ print(role.list_grant("Collection", "*"))
+ role.revoke("Global", "*", _PRIVILEGE_INSERT)
+ ```
+
+ ```java
+ // NOTE: please make sure the 'foo' db has been created
+ MilvusServiceClient client = new ConnectToMilvus().withDbName("foo").build();
+
+ // This role will have the insert permission of all collections under foo db,
+ // excluding the insert permissions of collections under other dbs
+ R response = client.grantRolePrivilege(GrantRolePriviledgeParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withObject("Collection")
+ .withObjectName("*")
+ .withPrivilege(PRIVILEGE_INSERT)
+ .build());
+
+ if (response.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(response.getMessage());
+ }
+
+ R grants = client.selectGrantForRole(SelectGrantForRoleParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .build());
+
+ if (grants.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(grants.getMessage());
+ }
+
+ System.out.println(grants.getData());
+
+ grants = client.selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withObject("Collection")
+ .withObjectName("*")
+ .build());
+
+ if (grants.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(grants.getMessage());
+ }
+
+ System.out.println(grants.getData());
+
+ response = client.revokeRolePrivilege(RevokeRolePrivilegeParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withObject("Global")
+ .withObjectName("*")
+ .withPrivilege(PRIVILEGE_INSERT)
+ .build());
+
+ if (response.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(response.getMessage());
+ }
+ ```
+
+ ```javascript
+ const client = connectToMilvus("foo");
+
+ async function demo() {}
+ await client.createRole({
+ roleName: ROLE_NAME,
+ });
+
+ const grants = await client.listGrants({
+ roleName: ROLE_NAME,
+ });
+
+ console.log(grants.grants);
+
+ await client.revokePrivilege({
+ roleName: ROLE_NAME,
+ object: "Global",
+ objectName: "*",
+ privilege: PRIVILEGE_INSERT,
+ });
+ ```
- If a Permission API call is made upon a Milvus connection, with or without `db_name` specified, **database** refers to the database whose name was specified in the Permission API call.
@@ -561,75 +557,75 @@ function connectToMilvus(dbName="default") {
Node.js
- ```python
- # NOTE: please make sure the 'foo' db has been created
-
- db_name = "foo"
- connect_to_milvus()
- role.grant("Collection", "*", _PRIVILEGE_INSERT, db_name=db_name)
- print(role.list_grants(db_name=db_name))
- print(role.list_grant("Collection", "*", db_name=db_name))
- role.revoke("Global", "*", _PRIVILEGE_INSERT, db_name=db_name)
- ```
-
- ```java
- // NOTE: please make sure the 'foo' db has been created
-
- String dbName = "foo";
- MilvusServiceClient client = new ConnectToMilvus().build();
-
- R response = client.grantRolePrivilege(GrantRolePriviledgeParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withObject("Collection")
- .withObjectName("*")
- .withPrivilege(PRIVILEGE_INSERT)
- .withDatabaseName(dbName)
- .build());
-
- if (response.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(response.getMessage());
- }
-
- R grants = client.selectGrantForRole(SelectGrantForRoleParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withDatabaseName(dbName)
- .build());
-
- if (grants.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(grants.getMessage());
- }
-
- System.out.println(grants.getData());
-
- grants = client.selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withObject("Collection")
- .withObjectName("*")
- .withDatabaseName(dbName)
- .build());
-
- if (grants.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(grants.getMessage());
- }
-
- System.out.println(grants.getData());
-
- response = client.revokeRolePrivilege(RevokeRolePrivilegeParam.newBuilder()
- .withRoleName(ROLE_NAME)
- .withObject("Global")
- .withObjectName("*")
- .withPrivilege(PRIVILEGE_INSERT)
- .withDatabaseName(dbName)
- .build());
-
- if (response.getStatus() != R.Status.Success.getCode()) {
- throw new RuntimeException(response.getMessage());
- }
- ```
-
- ```javascript
- // The Node.js SDK currently cannot support this case.
- ```
+ ```python
+ # NOTE: please make sure the 'foo' db has been created
+
+ db_name = "foo"
+ connect_to_milvus()
+ role.grant("Collection", "*", _PRIVILEGE_INSERT, db_name=db_name)
+ print(role.list_grants(db_name=db_name))
+ print(role.list_grant("Collection", "*", db_name=db_name))
+ role.revoke("Global", "*", _PRIVILEGE_INSERT, db_name=db_name)
+ ```
+
+ ```java
+ // NOTE: please make sure the 'foo' db has been created
+
+ String dbName = "foo";
+ MilvusServiceClient client = new ConnectToMilvus().build();
+
+ R response = client.grantRolePrivilege(GrantRolePriviledgeParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withObject("Collection")
+ .withObjectName("*")
+ .withPrivilege(PRIVILEGE_INSERT)
+ .withDatabaseName(dbName)
+ .build());
+
+ if (response.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(response.getMessage());
+ }
+
+ R grants = client.selectGrantForRole(SelectGrantForRoleParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withDatabaseName(dbName)
+ .build());
+
+ if (grants.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(grants.getMessage());
+ }
+
+ System.out.println(grants.getData());
+
+ grants = client.selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withObject("Collection")
+ .withObjectName("*")
+ .withDatabaseName(dbName)
+ .build());
+
+ if (grants.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(grants.getMessage());
+ }
+
+ System.out.println(grants.getData());
+
+ response = client.revokeRolePrivilege(RevokeRolePrivilegeParam.newBuilder()
+ .withRoleName(ROLE_NAME)
+ .withObject("Global")
+ .withObjectName("*")
+ .withPrivilege(PRIVILEGE_INSERT)
+ .withDatabaseName(dbName)
+ .build());
+
+ if (response.getStatus() != R.Status.Success.getCode()) {
+ throw new RuntimeException(response.getMessage());
+ }
+ ```
+
+ ```javascript
+ // The Node.js SDK currently cannot support this case.
+ ```
## What's next
diff --git a/site/en/userGuide/search-query-get/single-vector-search.md b/site/en/userGuide/search-query-get/single-vector-search.md
index fccbd81d1..96e1ecd2a 100644
--- a/site/en/userGuide/search-query-get/single-vector-search.md
+++ b/site/en/userGuide/search-query-get/single-vector-search.md
@@ -478,15 +478,15 @@ console.log(res.results)
data |
- A list of vector embeddings. Milvus searches for the most similar vector embeddings to the specified ones. |
+ A list of vector embeddings. Milvus searches for the most similar vector embeddings to the specified ones. |
limit |
- The total number of entities to return. You can use this parameter in combination with offset in param to enable pagination. The sum of this value and offset in param should be less than 16,384. |
+ The total number of entities to return. You can use this parameter in combination with offset in param to enable pagination. The sum of this value and offset in param should be less than 16,384. |
search_params |
- The parameter settings specific to this operation.
metric_type : The metric type applied to this operation. This should be the same as the one used when you index the vector field specified above. Possible values are L2, IP, COSINE, JACCARD, HAMMING.params : Additional parameters. For details, refer to search().
|
+ The parameter settings specific to this operation.
metric_type : The metric type applied to this operation. This should be the same as the one used when you index the vector field specified above. Possible values are L2, IP, COSINE, JACCARD, HAMMING.params : Additional parameters. For details, refer to search().
|
@@ -505,11 +505,11 @@ console.log(res.results)
data |
- A list of vector embeddings. Milvus searches for the most similar vector embeddings to the specified ones. |
+ A list of vector embeddings. Milvus searches for the most similar vector embeddings to the specified ones. |
topK |
- The number of records to return in the search result. This parameter uses the same syntax as the limit parameter, so you should only set one of them. You can use this parameter in combination with offset in param to enable pagination. The sum of this value and offset in param should be less than 16,384. |
+ The number of records to return in the search result. This parameter uses the same syntax as the limit parameter, so you should only set one of them. You can use this parameter in combination with offset in param to enable pagination. The sum of this value and offset in param should be less than 16,384. |
@@ -528,11 +528,11 @@ console.log(res.results)
data |
- A list of vector embeddings. Milvus searches for the most similar vector embeddings to the specified ones. |
+ A list of vector embeddings. Milvus searches for the most similar vector embeddings to the specified ones. |
limit |
- The total number of entities to return. You can use this parameter in combination with offset in param to enable pagination. The sum of this value and offset in param should be less than 16,384. |
+ The total number of entities to return. You can use this parameter in combination with offset in param to enable pagination. The sum of this value and offset in param should be less than 16,384. |
diff --git a/site/en/userGuide/search-query-get/with-iterators.md b/site/en/userGuide/search-query-get/with-iterators.md
index e32d3eba3..cdcb1d8b6 100644
--- a/site/en/userGuide/search-query-get/with-iterators.md
+++ b/site/en/userGuide/search-query-get/with-iterators.md
@@ -362,7 +362,7 @@ System.out.println(results.size());
data |
- A list of vector embeddings. Milvus searches for the most similar vector embeddings to the specified ones. |
+ A list of vector embeddings. Milvus searches for the most similar vector embeddings to the specified ones. |
anns_field |
@@ -370,19 +370,19 @@ System.out.println(results.size());
batch_size |
- The number of entities to return each time you call next() on the current iterator. The value defaults to 1000. Set it to a proper value to control the number of entities to return per iteration. |
+ The number of entities to return each time you call next() on the current iterator. The value defaults to 1000. Set it to a proper value to control the number of entities to return per iteration. |
param |
- The parameter settings specific to this operation.
metric_type : The metric type applied to this operation. This should be the same as the one used when you index the vector field specified above. Possible values are L2, IP, COSINE, JACCARD, HAMMING.params : Additional parameters. For details, refer to search_iterator().
|
+ The parameter settings specific to this operation.
metric_type : The metric type applied to this operation. This should be the same as the one used when you index the vector field specified above. Possible values are L2, IP, COSINE, JACCARD, HAMMING.params : Additional parameters. For details, refer to search_iterator().
|
output_fields |
- A list of field names to include in each entity in return. The value defaults to None. If left unspecified, only the primary field is included. |
+ A list of field names to include in each entity in return. The value defaults to None. If left unspecified, only the primary field is included. |
limit |
- The total number of entities to return. The value defaults to -1, indicating all matching entities will be in return. |
+ The total number of entities to return. The value defaults to -1, indicating all matching entities will be in return. |
@@ -409,7 +409,7 @@ System.out.println(results.size());
withBatchSize |
- The number of entities to return each time you call next() on the current iterator. The value defaults to 1000. Set it to a proper value to control the number of entities to return per iteration. |
+ The number of entities to return each time you call next() on the current iterator. The value defaults to 1000. Set it to a proper value to control the number of entities to return per iteration. |
withParams |
@@ -551,19 +551,19 @@ while (true) {
batch_size |
- The number of entities to return each time you call next() on the current iterator. The value defaults to 1000. Set it to a proper value to control the number of entities to return per iteration. |
+ The number of entities to return each time you call next() on the current iterator. The value defaults to 1000. Set it to a proper value to control the number of entities to return per iteration. |
expr |
- A scalar filtering condition to filter matching entities. The value defaults to None, indicating that scalar filtering is ignored. To build a scalar filtering condition, refer to Boolean Expression Rules. |
+ A scalar filtering condition to filter matching entities. The value defaults to None, indicating that scalar filtering is ignored. To build a scalar filtering condition, refer to Boolean Expression Rules. |
output_fields |
- A list of field names to include in each entity in return. The value defaults to None. If left unspecified, only the primary field is included. |
+ A list of field names to include in each entity in return. The value defaults to None. If left unspecified, only the primary field is included. |
limit |
- The total number of entities to return. The value defaults to -1, indicating all matching entities will be in return. |
+ The total number of entities to return. The value defaults to -1, indicating all matching entities will be in return. |
@@ -586,7 +586,7 @@ while (true) {
withBatchSize |
- The number of entities to return each time you call next() on the current iterator. The value defaults to 1000. Set it to a proper value to control the number of entities to return per iteration. |
+ The number of entities to return each time you call next() on the current iterator. The value defaults to 1000. Set it to a proper value to control the number of entities to return per iteration. |
addOutField |