diff --git a/API_Reference/milvus-restful/v2.3.x/About.md b/API_Reference/milvus-restful/v2.3.x/About.md new file mode 100644 index 000000000..88a37db1e --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/About.md @@ -0,0 +1,23 @@ +# Get Started + +Milvus offers RESTful API for you to manipulate your collections and data stored in them. Before you dive in, there are several things that are worth noting: + +## Understanding the API endpoints + +These API endpoints involve manipulating collections in a specified cluster as well as the data in a specific collection. + +The prefix of an API endpoint should always be the URI of your Milvus instance, such as `localhost:19530`. + +The following is the API endpoint used to list collections in a Milvus cluster. + +```shell +curl --request GET \ + --url '${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/collections' \ + --header 'Authorization: Bearer ' \ + --header 'accept: application/json' \ + --header 'content-type: application/json' +``` + +## Authentication credentials + +You can use a token as the authentication method when you access the API endpoints. To obtain a token, you should use a colon (:) to concatenate the username and password that you use to access your Milvus instance. For example, `root:milvus`. diff --git a/API_Reference/milvus-restful/v2.3.x/Collection Operations/create_collection.md b/API_Reference/milvus-restful/v2.3.x/Collection Operations/create_collection.md new file mode 100644 index 000000000..a16e4179f --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/Collection Operations/create_collection.md @@ -0,0 +1,118 @@ +# Create Collection + +Creates a collection in a cluster. + +
+
+ POST +
+ https://${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/collections/create +
+ +## Example + + +Create a collection named `medium_articles`: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/collections/create" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "dbName": "default", + "collectionName": "medium_articles", + "dimension": 256, + "metricType": "L2", + "primaryField": "id", + "vectorField": "vector" + }' +``` + +Success response: + +```shell +{ + "code": 200, + "data": {} +} +``` + + + +## Request + +### Parameters + +- No query parameters required + +- No path parameters required + +### Request Body + +```json +{ + "collectionName": "string", + "dbName": "string", + "description": "string", + "dimension": "integer", + "metricType": "string", + "primaryField": "string", + "vectorField": "string" +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `dbName` | **string**
The name of the database to which the collection to create belongs to. | +| `collectionName` | **string**(required)
The name of the collection to create.| +| `dimension` | **integer**(required)
The number of dimensions for the vector field of the collection.
The value ranges from **32** to **32768**.| +| `metricType` | **string**
The distance metric used for the collection.
The value defaults to **L2**.| +| `primaryField` | **string**
The primary key field.
The value defaults to **id**.| +| `vectorField` | **string**
The vector field.
The value defaults to **vector**.| +| `description` | **string**
The description of the collection| + +## Response + +Returns an empty object. + +### Response Bodies + +- Response body if we process your request successfully + +```json +{ + "code": 200, + "data": {} +} +``` + +- Response body if we failed to process your request + +```json +{ + "code": integer, + "message": string +} +``` + +### Properties + +The properties in the returned response are listed in the following table. + +| Property | Description | +|----------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `code` | **integer**
Indicates whether the request succeeds.
| +| `data` | **object**
A data object. | +| `message` | **string**
Indicates the possible reason for the reported error. | + +## Possible Errors + +| Error Code | Description | +| --- | --- | +| 800 | database not found | +| 1800 | user hasn't authenticate | +| 1801 | can only accept json format request | +| 1802 | missing required parameters | +| 1803 | fail to marshal collection schema | diff --git a/API_Reference/milvus-restful/v2.3.x/Collection Operations/describe_collection.md b/API_Reference/milvus-restful/v2.3.x/Collection Operations/describe_collection.md new file mode 100644 index 000000000..d2f316ebb --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/Collection Operations/describe_collection.md @@ -0,0 +1,151 @@ +# Describe Collection + +Describes the details of a collection. + +
+
+ GET +
+ https://${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/collections/describe +
+ +## Example + + +Describe the details of a collection named `medium_articles`: + +```shell +curl --request GET \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/collections/describe?collectionName=medium_articles" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" +``` + +Success response: + +```shell +{ + "code": 200, + "data": { + "collectionName": "string", + "description": "string", + "fields": [ + { + "autoId": true, + "description": "string", + "name": "string", + "primaryKey": true, + "type": "string" + } + ], + "indexes": [ + { + "fieldName": "string", + "indexName": "string", + "metricType": "string" + } + ], + "load": "string", + "shardsNum": 0, + "enableDynamicField": true + } +} +``` + + + +## Request + +### Parameters + +- Query parameters + + | Parameter | Description | + |------------------|-------------------------------------------------------------------------------------------| + | `collectionName` | **string**(required)
The name of the collection to describe.| + +- No path parameters required + +### Request Body + +No request body required + +## Response + +Returns the specified collection in detail. + +### Response Bodies + +- Response body if we process your request successfully + +```json +{ + "code": 200, + "data": { + "collectionName": "string", + "description": "string", + "enableDynamicField": "boolean", + "fields": [ + { + "autoId": "boolean", + "description": "string", + "name": "string", + "primaryKey": "boolean", + "type": "string" + } + ], + "indexes": [ + { + "fieldName": "string", + "indexName": "string", + "metricType": "string" + } + ], + "load": "string", + "shardsNum": "integer" + } +} +``` + +- Response body if we failed to process your request + +```json +{ + "code": integer, + "message": string +} +``` + +### Properties + +The properties in the returned response are listed in the following table. + +| Property | Description | +|----------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `code` | **integer**
Indicates whether the request succeeds.
| +| `data` | **object**
A data object. | +| `data.collectionName` | **string**
The name of the collection. | +| `data.description` | **string**
An optional description of the collection. | +| `data.fields` | **array**
An field array | +| `data.fields[].autoId` | **boolean**
Whether the primary key automatically increments. | +| `data.fields[].description` | **string**
An optional description of the field. | +| `data.fields[].name` | **string**
The name of the field. | +| `data.fields[].primaryKey` | **boolean**
Whether the field is a primary field. | +| `data.fields[].type` | **string**
The data type of the values in this field. | +| `data.indexes` | **array**
An index array | +| `data.indexes[].fieldName` | **string**
The name of the indexed field. | +| `data.indexes[].indexName` | **string**
The name of the generated index files. | +| `data.indexes[].metricType` | **string**
The metric type used in the index process. | +| `data.load` | **string**
The load status of the collection. Possible values are **unload**, **loading**, and **loaded**. | +| `data.shardsNum` | **integer**
The number of shards in the collection. | +| `data.enableDynamicField` | **boolean**
Whether the dynamic JSON feature is enabled for this collection. | +| `message` | **string**
Indicates the possible reason for the reported error. | + +## Possible Errors + +| Error Code | Description | +| --- | --- | +| 800 | database not found | +| 1800 | user hasn't authenticate | +| 1802 | missing required parameters | diff --git a/API_Reference/milvus-restful/v2.3.x/Collection Operations/drop_collection.md b/API_Reference/milvus-restful/v2.3.x/Collection Operations/drop_collection.md new file mode 100644 index 000000000..9506ede16 --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/Collection Operations/drop_collection.md @@ -0,0 +1,100 @@ +# Drop Collection + +Drops a collection. This operation erases your collection data. Exercise caution when performing this operation. + +
+
+ POST +
+ https://${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/collections/drop +
+ +## Example + + +Drop a collection named `medium_articles`: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/collections/drop" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles" + }' +``` + +Success response: + +```shell +{ + "code": 200, + "data": {} +} +``` + + + +## Request + +### Parameters + +- No query parameters required + +- No path parameters required + +### Request Body + +```json +{ + "collectionName": "string" +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to delete.| + +## Response + +Returns an empty object. + +### Response Bodies + +- Response body if we process your request successfully + +```json +{ + "code": 200, + "data": {} +} +``` + +- Response body if we failed to process your request + +```json +{ + "code": integer, + "message": string +} +``` + +### Properties + +The properties in the returned response are listed in the following table. + +| Property | Description | +|----------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `code` | **integer**
Indicates whether the request succeeds.
| +| `data` | **object**
A data object. | +| `message` | **string**
Indicates the possible reason for the reported error. | + +## Possible Errors + +| Error Code | Description | +| --- | --- | +| 800 | database not found | +| 1800 | user hasn't authenticate | +| 1801 | can only accept json format request | +| 1802 | missing required parameters | diff --git a/API_Reference/milvus-restful/v2.3.x/Collection Operations/list_collections.md b/API_Reference/milvus-restful/v2.3.x/Collection Operations/list_collections.md new file mode 100644 index 000000000..593b4deae --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/Collection Operations/list_collections.md @@ -0,0 +1,92 @@ +# List Collections + +Lists collections in a cluster. + +
+
+ GET +
+ https://${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/collections +
+ +## Example + + +List all collections in a cluster: + +```shell +curl --request GET \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/collections" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" +``` + +Sample response: + +```shell +{ + code: 200, + data: [ + "collection1", + "collection2", + ... + "collectionN", + ] +} +``` + + + +## Request + +### Parameters + +- No query parameters required + +- No path parameters required + +### Request Body + +No request body required + +## Response + +Returns a list of collections in the specified cluster. + +### Response Bodies + +- Response body if we process your request successfully + +```json +{ + "code": 200, + "data": {} +} +``` + +- Response body if we failed to process your request + +```json +{ + "code": integer, + "message": string +} +``` + +### Properties + +The properties in the returned response are listed in the following table. + +| Property | Description | +|----------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `code` | **integer**
Indicates whether the request succeeds.
| +| `data` | **array**
A data array of strings. | +| `message` | **string**
Indicates the possible reason for the reported error. | + +## Possible Errors + +| Error Code | Description | +| --- | --- | +| 800 | database not found | +| 1800 | user hasn't authenticate | diff --git a/API_Reference/milvus-restful/v2.3.x/Restful API.openapi.json b/API_Reference/milvus-restful/v2.3.x/Restful API.openapi.json new file mode 100644 index 000000000..ff8baa2d2 --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/Restful API.openapi.json @@ -0,0 +1,1393 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Restful API", + "description": "", + "version": "1.0.0" + }, + "tags": [ + { + "name": "Collection Operations" + }, + { + "name": "Vector Operations" + } + ], + "paths": { + "/v1/vector/collections": { + "get": { + "summary": "List Collections", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Lists collections in a cluster.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "example": "", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Returns a list of collections in the specified cluster.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/httpapi.GenericResp-customer_ListCollectionsResp" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767175-run" + } + }, + "/v1/vector/collections/create": { + "post": { + "summary": "Create Collection", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Creates a collection in a cluster.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CollectionCreateSimple" + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns an empty object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/httpapi.GenericResp-customer_CreateIndexResp" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767176-run" + } + }, + "/v1/vector/collections/describe": { + "get": { + "summary": "Describe Collection", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Describes the details of a collection.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "collectionName", + "in": "query", + "description": "The name of the collection to describe.", + "required": true, + "example": "", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Returns the specified collection in detail.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/httpapi.GenericResp-customer_DescCollectionResp" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767177-run" + } + }, + "/v1/vector/collections/drop": { + "post": { + "summary": "Drop Collection", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Drops a collection. This operation erases your collection data. Exercise caution when performing this operation.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/customer.DropCollectionReq" + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns an empty object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/httpapi.GenericResp-customer_DropCollectionResp" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767178-run" + } + }, + "/v1/vector/delete": { + "post": { + "summary": "Delete", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Deletes one or more entities from a collection.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "string", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "integer", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + } + ] + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns an empty object.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/httpapi.GenericResp-customer_DeleteResp" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767179-run" + } + }, + "/v1/vector/insert": { + "post": { + "summary": "Insert", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Inserts one or more entities into a collection.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "x-apifox-orders": [ + "collectionName", + "data" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which entities will be inserted." + }, + "data": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "description": "An entity object. Note that the keys in the entity should match the collection schema.", + "x-apifox-ignore-properties": [] + } + }, + "required": [ + "collectionName", + "data" + ], + "x-apifox-ignore-properties": [] + }, + { + "$ref": "#/components/schemas/customer.InsertReq" + } + ] + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns the number of inserted entities and an array of their IDs.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/httpapi.GenericResp-customer_InsertResp" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767180-run" + } + }, + "/v1/vector/search": { + "post": { + "summary": "Search", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Conducts a similarity search in a collection. ", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "x-apifox-refs": { + "01H1PFY2ZE8WYR08AGKW1MBY8M": { + "$ref": "#/components/schemas/customer.SearchOrQueryReq", + "x-apifox-overrides": { + "level": { + "type": "integer", + "description": "The precision level of the results can be adjusted using values **1**, **2**, or **3**. Higher precision levels lead to more accurate results but take longer to compute. The default value is 1, which prioritizes speed over accuracy.", + "default": 1 + } + } + } + }, + "x-apifox-orders": [ + "01H1PFY2ZE8WYR08AGKW1MBY8M" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search" + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value of that of `offset` should be less than **1024**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should not be greater than **1024**.", + "minimum": 0, + "maximum": 1024, + "exclusiveMinimum": true + }, + "outputFields": { + "type": "array", + "items": { + "type": "string", + "default": "id, distance" + }, + "description": "An array of fields to return along with the search results." + }, + "vector": { + "type": "array", + "items": { + "type": "number", + "format": "float32" + }, + "description": "The query vector in the form of a list of floating numbers." + } + }, + "required": [ + "collectionName", + "vector" + ], + "x-apifox-ignore-properties": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields", + "vector" + ] + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns the search results.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "x-apifox-ignore-properties": [] + } + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [] + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767181-run" + } + }, + "/v1/vector/query": { + "post": { + "summary": "Query", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Conducts a vector query in a collection.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search." + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value and that of `offset` should be less than **16384**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should be less than **16384**.", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 16384 + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + } + }, + "x-apifox-refs": { + "01H0KV6DX6NKH0PHSNRYW8XD4S": { + "$ref": "#/components/schemas/customer.QueryReq" + } + }, + "x-apifox-orders": [ + "01H0KV6DX6NKH0PHSNRYW8XD4S" + ], + "required": [ + "collectionName", + "filter" + ], + "x-apifox-ignore-properties": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields" + ] + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns the search results.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "x-apifox-ignore-properties": [] + } + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [] + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-82167294-run" + } + }, + "/v1/vector/get": { + "post": { + "summary": "Get", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Gets entities by the specified IDs.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "$ref": "#/components/schemas/customer.GetReq1" + }, + { + "$ref": "#/components/schemas/customer.GetReq2" + }, + { + "type": "object", + "x-apifox-refs": { + "01H0KWBZQSHZ451Z4A9YQ9WQTA": { + "$ref": "#/components/schemas/customer.GetReq3", + "x-apifox-overrides": { + "id": { + "type": "integer", + "description": "The ID of entity to be retrieved" + } + }, + "required": [ + "id" + ] + } + }, + "x-apifox-orders": [ + "01H0KWBZQSHZ451Z4A9YQ9WQTA" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "integer", + "description": "The ID of entity to be retrieved" + } + }, + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [ + "collectionName", + "outputFields", + "id" + ] + }, + { + "$ref": "#/components/schemas/customer.GetReq4" + } + ] + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns the search results.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "x-apifox-ignore-properties": [] + } + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [] + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-82172081-run" + } + } + }, + "components": { + "schemas": { + "customer.GetReq4": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.GetReq3": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "integer", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.GetReq2": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.GetReq1": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "string", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.QueryReq": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search." + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value and that of `offset` should be less than **16384**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should be less than **16384**.", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 16384 + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + } + }, + "x-apifox-orders": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields" + ], + "required": [ + "collectionName", + "filter" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.SearchOrQueryReq": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search" + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value of that of `offset` should be less than **1024**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should not be greater than **1024**.", + "minimum": 0, + "maximum": 1024, + "exclusiveMinimum": true + }, + "outputFields": { + "type": "array", + "items": { + "type": "string", + "default": "id, distance" + }, + "description": "An array of fields to return along with the search results." + }, + "vector": { + "type": "array", + "items": { + "type": "number", + "format": "float32" + }, + "description": "The query vector in the form of a list of floating numbers." + } + }, + "x-apifox-orders": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields", + "vector" + ], + "required": [ + "collectionName", + "vector" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_InsertResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "$ref": "#/components/schemas/customer.InsertResp" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.InsertResp": { + "type": "object", + "properties": { + "insertCount": { + "type": "integer", + "examples": [ + 4 + ], + "description": "The number of inserted entities." + }, + "insertIds": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "['id1'", + " 'id2'", + " 'id3']" + ] + ], + "description": "An array of the IDs of inserted entities." + } + }, + "x-apifox-orders": [ + "insertCount", + "insertIds" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.InsertReq": { + "type": "object", + "required": [ + "data", + "collectionName" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which entities will be inserted." + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [] + }, + "description": "An array of entity objects. Note that the keys in an entity object should match the collection schema" + } + }, + "x-apifox-orders": [ + "collectionName", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_DeleteResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "$ref": "#/components/schemas/customer.DeleteResp" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DeleteResp": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_DropCollectionResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "$ref": "#/components/schemas/customer.DropCollectionResp" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DropCollectionResp": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DropCollectionReq": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to delete." + } + }, + "x-apifox-orders": [ + "collectionName" + ], + "required": [ + "collectionName" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_DescCollectionResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "$ref": "#/components/schemas/customer.DescCollectionResp" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DescCollectionResp": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection." + }, + "description": { + "type": "string", + "description": "An optional description of the collection." + }, + "fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/customer.DescField" + }, + "description": "An field array" + }, + "indexes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/customer.DescIndex" + }, + "description": "An index array" + }, + "load": { + "type": "string", + "description": "The load status of the collection. Possible values are **unload**, **loading**, and **loaded**." + }, + "shardsNum": { + "type": "integer", + "description": "The number of shards in the collection." + }, + "enableDynamicField": { + "type": "boolean", + "description": "Whether the dynamic JSON feature is enabled for this collection." + } + }, + "x-apifox-orders": [ + "collectionName", + "description", + "fields", + "indexes", + "load", + "shardsNum", + "enableDynamicField" + ], + "required": [ + "enableDynamicField" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DescIndex": { + "type": "object", + "properties": { + "fieldName": { + "type": "string", + "description": "The name of the indexed field." + }, + "indexName": { + "type": "string", + "description": "The name of the generated index files." + }, + "metricType": { + "type": "string", + "description": "The metric type used in the index process." + } + }, + "x-apifox-orders": [ + "fieldName", + "indexName", + "metricType" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DescField": { + "type": "object", + "properties": { + "autoId": { + "type": "boolean", + "description": "Whether the primary key automatically increments." + }, + "description": { + "type": "string", + "description": "An optional description of the field." + }, + "name": { + "type": "string", + "description": "The name of the field." + }, + "primaryKey": { + "type": "boolean", + "description": "Whether the field is a primary field." + }, + "type": { + "type": "string", + "description": "The data type of the values in this field." + } + }, + "x-apifox-orders": [ + "autoId", + "description", + "name", + "primaryKey", + "type" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_CreateIndexResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "$ref": "#/components/schemas/customer.CreateIndexResp" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.CreateIndexResp": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "CollectionCreateSimple": { + "type": "object", + "properties": { + "dbName": { + "type": "string", + "description": "The name of the database to which the collection to create belongs to. This parameter applies only to dedicated clusters." + }, + "collectionName": { + "type": "string", + "description": "The name of the collection to create." + }, + "dimension": { + "type": "integer", + "description": "The number of dimensions for the vector field of the collection.", + "minimum": 32, + "maximum": 32768 + }, + "metricType": { + "type": "string", + "description": "The distance metric used for the collection.", + "default": "L2" + }, + "primaryField": { + "type": "string", + "description": "The primary key field.", + "default": "id" + }, + "vectorField": { + "type": "string", + "description": "The vector field.", + "default": "vector" + }, + "description": { + "type": "string", + "description": "The description of the collection" + } + }, + "required": [ + "collectionName", + "dimension" + ], + "x-apifox-orders": [ + "dbName", + "collectionName", + "dimension", + "metricType", + "primaryField", + "vectorField", + "description" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_ListCollectionsResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + }, + "servers": [] +} \ No newline at end of file diff --git a/API_Reference/milvus-restful/v2.3.x/Vector Operations/delete.md b/API_Reference/milvus-restful/v2.3.x/Vector Operations/delete.md new file mode 100644 index 000000000..76f4e73f9 --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/Vector Operations/delete.md @@ -0,0 +1,172 @@ +# Delete + +Deletes one or more entities from a collection. + +
+
+ POST +
+ https://${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/delete +
+ +## Example + + +Delete a collection whose ID is an integer: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/delete" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "id": 1 + }' +``` + +Delete a collection whose ID is a string: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/delete" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "id": "id1" + }' +``` + +Delete a list of collections whose IDs are integers: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/delete" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "id": [1,2,3,4] + }' +``` + +Delete a list of collections whose IDs are strings: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/delete" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "id": ["id1", "id2", "id3","id4"] + }' +``` + + +## Request + +### Parameters + +- No query parameters required + +- No path parameters required + +### Request Body + +```json +{ + "collectionName": "string", + "id": "string" +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which this operation applies.| +| `id` | **string**(required)
The ID of the entity to be retrieved| + +```json +{ + "collectionName": "string", + "id": [] +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which this operation applies.| +| `id` | **array**(required)
An array of IDs of the entities to be retrieved| + +```json +{ + "collectionName": "string", + "id": "integer" +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which this operation applies.| +| `id` | **integer**(required)
The ID of the entity to be retrieved| + +```json +{ + "collectionName": "string", + "id": [] +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which this operation applies.| +| `id` | **array**(required)
An array of IDs of the entities to be retrieved| + +## Response + +Returns an empty object. + +### Response Bodies + +- Response body if we process your request successfully + +```json +{ + "code": 200, + "data": {} +} +``` + +- Response body if we failed to process your request + +```json +{ + "code": integer, + "message": string +} +``` + +### Properties + +The properties in the returned response are listed in the following table. + +| Property | Description | +|----------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `code` | **integer**
Indicates whether the request succeeds.
| +| `data` | **object**
A data object. | +| `message` | **string**
Indicates the possible reason for the reported error. | + +## Possible Errors + +| Error Code | Description | +| --- | --- | +| 800 | database not found | +| 1800 | user hasn't authenticate | +| 1801 | can only accept json format request | +| 1802 | missing required parameters | +| 1806 | please check the primary key and its' type can only in [int | diff --git a/API_Reference/milvus-restful/v2.3.x/Vector Operations/get.md b/API_Reference/milvus-restful/v2.3.x/Vector Operations/get.md new file mode 100644 index 000000000..594ec95ca --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/Vector Operations/get.md @@ -0,0 +1,186 @@ +# Get + +Gets entities by the specified IDs. + +
+
+ POST +
+ https://${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/get +
+ +## Example + + +Get a specified entity whose ID is an integer: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/get" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "outputFields": ["id", "title", "link"], + "id": 1 + }' +``` + +Get a specified entity whose ID is a string: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/get" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "outputFields": ["id", "title", "link"], + "id": "id1" + }' +``` + +Get a list of entities whose IDs are integers: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/get" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "outputFields": ["id", "title", "link"], + "id": [1, 2] + }' +``` + +Get a list of entities whose IDs are strings: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/get" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d "{ + "collectionName": "medium_articles", + "outputFields": ["id", "title", "link"], + "id": ["id1", "id2"] + }" +``` + + + +## Request + +### Parameters + +- No query parameters required + +- No path parameters required + +### Request Body + +```json +{ + "collectionName": "string", + "id": "string", + "outputFields": [] +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which this operation applies.| +| `outputFields` | **array**
An array of fields to return along with the search results.| +| `id` | **string**(required)
The ID of the entity to be retrieved| + +```json +{ + "collectionName": "string", + "id": [], + "outputFields": [] +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which this operation applies.| +| `outputFields` | **array**
An array of fields to return along with the search results.| +| `id` | **array**(required)
An array of IDs of the entities to be retrieved| + +```json +{ + "collectionName": "string", + "id": "integer", + "outputFields": [] +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which this operation applies.| +| `outputFields` | **array**
An array of fields to return along with the search results.| +| `id` | **integer**(required)
The ID of entity to be retrieved| + +```json +{ + "collectionName": "string", + "id": [], + "outputFields": [] +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which this operation applies.| +| `outputFields` | **array**
An array of fields to return along with the search results.| +| `id` | **array**(required)
An array of IDs of the entities to be retrieved| + +## Response + +Returns the search results. + +### Response Bodies + +- Response body if we process your request successfully + +```json +{ + "code": 200, + "data": {} +} +``` + +- Response body if we failed to process your request + +```json +{ + "code": integer, + "message": string +} +``` + +### Properties + +The properties in the returned response are listed in the following table. + +| Property | Description | +|----------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `code` | **integer**
Indicates whether the request succeeds.
| +| `data` | **array**
A data array of objects. | +| `message` | **string**
Indicates the possible reason for the reported error. | + +## Possible Errors + +| Error Code | Description | +| --- | --- | +| 800 | database not found | +| 1800 | user hasn't authenticate | +| 1801 | can only accept json format request | +| 1802 | missing required parameters | +| 1805 | fail to parse search result | +| 1806 | please check the primary key and its' type can only in [int | diff --git a/API_Reference/milvus-restful/v2.3.x/Vector Operations/insert.md b/API_Reference/milvus-restful/v2.3.x/Vector Operations/insert.md new file mode 100644 index 000000000..58c950af7 --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/Vector Operations/insert.md @@ -0,0 +1,137 @@ +# Insert + +Inserts one or more entities into a collection. + +
+
+ POST +
+ https://${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/insert +
+ +## Example + + +Insert an entity to a collection named `collection1`: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/insert" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "data": [{ + "vector": [0.23254494, 0.01374953, 0.88497432, 0.05292784, 0.02204868, 0.21890409, 0.35428028, 0.97024438, 0.58635726, 0.67980838, 0.67202523, 0.16375636, 0.52829526, 0.80185865, 0.71167799, 0.98615784, 0.86350404, 0.64295726, 0.37624468, 0.99708253, 0.46243643, 0.32893164, 0.32094438, 0.47701896, 0.85275669, 0.13127097, 0.5889451, 0.97648346, 0.74876674, 0.66409428, 0.92279568, 0.59029588, 0.495616, 0.12791323, 0.90082737, 0.84513226, 0.47542935, 0.74928086, 0.44922073, 0.1020575, 0.37431645, 0.29738807, 0.71098564, 0.35390859, 0.87792487, 0.89928066, 0.4995833, 0.61043433, 0.55303136, 0.02036885, 0.02231103, 0.67648899, 0.72165575, 0.15671427, 0.00546115, 0.28756084, 0.15077446, 0.65105982, 0.44063386, 0.07762012, 0.59994796, 0.19935778, 0.58911788, 0.54601686, 0.47097711, 0.90082361, 0.05595469, 0.38546197, 0.91447695, 0.33456871, 0.12778749, 0.82224433, 0.3223666, 0.56243253, 0.72730363, 0.42176339, 0.02008885, 0.11265533, 0.71246733, 0.86685866, 0.5204902, 0.1653007, 0.80375364, 0.14031363, 0.76868394, 0.35325028, 0.1142984, 0.95218926, 0.37508951, 0.01396396, 0.16322817, 0.69052937, 0.30264489, 0.40555134, 0.06153988, 0.00101791, 0.18618961, 0.77599691, 0.3445008, 0.7106463, 0.13440427, 0.64690627, 0.40818622, 0.07025781, 0.89639434, 0.00494204, 0.10540909, 0.47865809, 0.47316137, 0.46836499, 0.93197388, 0.24012326, 0.49471039, 0.21283529, 0.47370547, 0.95777027, 0.50557255, 0.12809693, 0.79998351, 0.76532556, 0.3412945, 0.72270631, 0.3432966, 0.81465781, 0.6924483, 0.2885265, 0.84673871, 0.38711232, 0.18702427, 0.49496971, 0.65431764, 0.39590077, 0.31226873, 0.20910631, 0.86433119, 0.51681312, 0.77759473, 0.42447517, 0.05762998, 0.17887886, 0.41045186, 0.09120965, 0.6447974, 0.49632173, 0.72730052, 0.26646776, 0.48899696, 0.33221734, 0.98206029, 0.82591894, 0.28478645, 0.37324246, 0.35833242, 0.96558445, 0.5003729, 0.66676758, 0.7230707, 0.21599462, 0.70457393, 0.11649283, 0.03034646, 0.00318578, 0.57941155, 0.80640383, 0.30106438, 0.84618622, 0.02321722, 0.6453211, 0.31889303, 0.20069267, 0.19202631, 0.84127804, 0.06014367, 0.53307321, 0.78079442, 0.32043145, 0.30207626, 0.08691769, 0.07230655, 0.8059663, 0.03810803, 0.05415744, 0.44057945, 0.19306693, 0.75747746, 0.89299566, 0.82985846, 0.5958096, 0.89525864, 0.07336388, 0.38396764, 0.04846415, 0.56839423, 0.56106259, 0.14302027, 0.85109589, 0.6298057, 0.62168794, 0.24771729, 0.54924417, 0.9061572, 0.97241046, 0.33025088, 0.56675472, 0.72474551, 0.48314604, 0.26248324, 0.22614522, 0.13087051, 0.9292656, 0.80039537, 0.38300443, 0.78520422, 0.29857615, 0.19121419, 0.47509572, 0.35981825, 0.55131999, 0.04348036, 0.02168964, 0.80645188, 0.62876989, 0.70794394, 0.72093526, 0.85172951, 0.24799777, 0.97620833, 0.74877332, 0.92792629, 0.89200055, 0.74500415, 0.84596926, 0.97469625, 0.7171343, 0.30020491, 0.97313677, 0.241573, 0.15498676, 0.21273237, 0.58910547, 0.46249576, 0.01109894, 0.0180376, 0.80975073, 0.12900483, 0.96509751, 0.57304458, 0.73290638, 0.94211456, 0.35197941, 0.15532272, 0.76150926, 0.19317378, 0.72826792, 0.38820115, 0.94187109], + "title": "Top 10 In-Demand programming languages to learn in 2020", + "link": "https://towardsdatascience.com/top-10-in-demand-programming-languages-to-learn-in-2020-4462eb7d8d3e" + }] + }' +``` + +Insert multiple entities: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/insert" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "data": [{ + "vector": [0.23254494, 0.01374953, 0.88497432, 0.05292784, 0.02204868, 0.21890409, 0.35428028, 0.97024438, 0.58635726, 0.67980838, 0.67202523, 0.16375636, 0.52829526, 0.80185865, 0.71167799, 0.98615784, 0.86350404, 0.64295726, 0.37624468, 0.99708253, 0.46243643, 0.32893164, 0.32094438, 0.47701896, 0.85275669, 0.13127097, 0.5889451, 0.97648346, 0.74876674, 0.66409428, 0.92279568, 0.59029588, 0.495616, 0.12791323, 0.90082737, 0.84513226, 0.47542935, 0.74928086, 0.44922073, 0.1020575, 0.37431645, 0.29738807, 0.71098564, 0.35390859, 0.87792487, 0.89928066, 0.4995833, 0.61043433, 0.55303136, 0.02036885, 0.02231103, 0.67648899, 0.72165575, 0.15671427, 0.00546115, 0.28756084, 0.15077446, 0.65105982, 0.44063386, 0.07762012, 0.59994796, 0.19935778, 0.58911788, 0.54601686, 0.47097711, 0.90082361, 0.05595469, 0.38546197, 0.91447695, 0.33456871, 0.12778749, 0.82224433, 0.3223666, 0.56243253, 0.72730363, 0.42176339, 0.02008885, 0.11265533, 0.71246733, 0.86685866, 0.5204902, 0.1653007, 0.80375364, 0.14031363, 0.76868394, 0.35325028, 0.1142984, 0.95218926, 0.37508951, 0.01396396, 0.16322817, 0.69052937, 0.30264489, 0.40555134, 0.06153988, 0.00101791, 0.18618961, 0.77599691, 0.3445008, 0.7106463, 0.13440427, 0.64690627, 0.40818622, 0.07025781, 0.89639434, 0.00494204, 0.10540909, 0.47865809, 0.47316137, 0.46836499, 0.93197388, 0.24012326, 0.49471039, 0.21283529, 0.47370547, 0.95777027, 0.50557255, 0.12809693, 0.79998351, 0.76532556, 0.3412945, 0.72270631, 0.3432966, 0.81465781, 0.6924483, 0.2885265, 0.84673871, 0.38711232, 0.18702427, 0.49496971, 0.65431764, 0.39590077, 0.31226873, 0.20910631, 0.86433119, 0.51681312, 0.77759473, 0.42447517, 0.05762998, 0.17887886, 0.41045186, 0.09120965, 0.6447974, 0.49632173, 0.72730052, 0.26646776, 0.48899696, 0.33221734, 0.98206029, 0.82591894, 0.28478645, 0.37324246, 0.35833242, 0.96558445, 0.5003729, 0.66676758, 0.7230707, 0.21599462, 0.70457393, 0.11649283, 0.03034646, 0.00318578, 0.57941155, 0.80640383, 0.30106438, 0.84618622, 0.02321722, 0.6453211, 0.31889303, 0.20069267, 0.19202631, 0.84127804, 0.06014367, 0.53307321, 0.78079442, 0.32043145, 0.30207626, 0.08691769, 0.07230655, 0.8059663, 0.03810803, 0.05415744, 0.44057945, 0.19306693, 0.75747746, 0.89299566, 0.82985846, 0.5958096, 0.89525864, 0.07336388, 0.38396764, 0.04846415, 0.56839423, 0.56106259, 0.14302027, 0.85109589, 0.6298057, 0.62168794, 0.24771729, 0.54924417, 0.9061572, 0.97241046, 0.33025088, 0.56675472, 0.72474551, 0.48314604, 0.26248324, 0.22614522, 0.13087051, 0.9292656, 0.80039537, 0.38300443, 0.78520422, 0.29857615, 0.19121419, 0.47509572, 0.35981825, 0.55131999, 0.04348036, 0.02168964, 0.80645188, 0.62876989, 0.70794394, 0.72093526, 0.85172951, 0.24799777, 0.97620833, 0.74877332, 0.92792629, 0.89200055, 0.74500415, 0.84596926, 0.97469625, 0.7171343, 0.30020491, 0.97313677, 0.241573, 0.15498676, 0.21273237, 0.58910547, 0.46249576, 0.01109894, 0.0180376, 0.80975073, 0.12900483, 0.96509751, 0.57304458, 0.73290638, 0.94211456, 0.35197941, 0.15532272, 0.76150926, 0.19317378, 0.72826792, 0.38820115, 0.94187109], + "title": "Top 10 In-Demand programming languages to learn in 2020", + "link": "https://towardsdatascience.com/top-10-in-demand-programming-languages-to-learn-in-2020-4462eb7d8d3e" + },{ + "vector": [0.4882628, 0.85768371, 0.48556888, 0.9681036, 0.94807827, 0.80656861, 0.72123286, 0.81810534, 0.83713905, 0.73258409, 0.97732714, 0.09869599, 0.83189308, 0.33537219, 0.88647192, 0.66132137, 0.703723, 0.34379603, 0.74785059, 0.84559156, 0.65074354, 0.61864253, 0.73546132, 0.84872955, 0.6006182, 0.04830389, 0.37780669, 0.96101751, 0.22319285, 0.88504273, 0.44813016, 0.69746754, 0.5707871, 0.37386075, 0.25382573, 0.42397712, 0.89749552, 0.39729882, 0.38485115, 0.12583234, 0.47243267, 0.74576701, 0.45814588, 0.88024839, 0.72812605, 0.6622232, 0.31803479, 0.74101011, 0.76141925, 0.5024863, 0.47431501, 0.40002184, 0.45752955, 0.54383915, 0.67569667, 0.52164475, 0.33647519, 0.93068322, 0.65766685, 0.95959175, 0.83665213, 0.1753687, 0.27341319, 0.34550907, 0.79669369, 0.95065082, 0.30838918, 0.79784458, 0.37323557, 0.97728813, 0.11170225, 0.87876854, 0.85212036, 0.88599461, 0.76916602, 0.6094099, 0.4427332, 0.87373443, 0.18576099, 0.81970137, 0.74932009, 0.92106027, 0.76417889, 0.35671825, 0.09990157, 0.14570871, 0.43084067, 0.30551776, 0.63985873, 0.45777184, 0.16172334, 0.32226743, 0.27613814, 0.18182943, 0.7019827, 0.45446168, 0.31359211, 0.17426952, 0.19392872, 0.59816543, 0.31679765, 0.60059089, 0.92800561, 0.95165562, 0.55177484, 0.49510178, 0.60250447, 0.1519485, 0.33565446, 0.92865767, 0.86723503, 0.85392181, 0.85337828, 0.01631286, 0.25257909, 0.00124323, 0.59344951, 0.78468014, 0.61854741, 0.61980932, 0.87467147, 0.44361724, 0.97777631, 0.42543721, 0.5290862, 0.12384163, 0.45287003, 0.30333621, 0.10408064, 0.71930918, 0.90741917, 0.09838064, 0.66319033, 0.08133113, 0.30527365, 0.40877414, 0.11552966, 0.76451148, 0.00529968, 0.76741598, 0.90358724, 0.05710312, 0.32659557, 0.66143926, 0.3258203, 0.62721598, 0.18690116, 0.00184847, 0.11355109, 0.33962499, 0.64671448, 0.67297271, 0.02416349, 0.3173442, 0.54041374, 0.33752188, 0.75654937, 0.08236666, 0.40054276, 0.1021504, 0.20874325, 0.75615835, 0.54953906, 0.44659766, 0.16064502, 0.58682242, 0.15547067, 0.57503622, 0.07797247, 0.1559962, 0.94815864, 0.12474807, 0.0999395, 0.85504252, 0.55633022, 0.56959553, 0.75966109, 0.70444125, 0.66884798, 0.81692129, 0.06837097, 0.9714623, 0.86751075, 0.42125912, 0.44367403, 0.49978621, 0.32267559, 0.67220653, 0.56167557, 0.25248436, 0.94191099, 0.71508807, 0.64564731, 0.56824345, 0.29187781, 0.93961505, 0.28196959, 0.92713673, 0.7256734, 0.51042292, 0.81504509, 0.55849401, 0.19380059, 0.46767559, 0.52275063, 0.66075204, 0.97290358, 0.57524932, 0.7219121, 0.85188581, 0.26220385, 0.75686621, 0.51934907, 0.185452, 0.49708297, 0.95783663, 0.61397962, 0.45956795, 0.49311061, 0.49464425, 0.43094667, 0.76768303, 0.29252745, 0.57964633, 0.72950803, 0.94616381, 0.60436868, 0.47828997, 0.90345857, 0.92971537, 0.64784105, 0.18095567, 0.94852017, 0.05224637, 0.50829763, 0.89020778, 0.008269, 0.9500583, 0.20305412, 0.21179052, 0.28443536, 0.39540241, 0.20286982, 0.30968133, 0.2141927, 0.4390286, 0.12686093, 0.59583271, 0.88270185, 0.28187656, 0.90096987, 0.29104497, 0.38480562, 0.40069773, 0.52293091, 0.37621525], + "title": "Dashboards in Python: 3 Advanced Examples for Dash Beginners and Everyone Else", + "link": "https://medium.com/swlh/dashboards-in-python-3-advanced-examples-for-dash-beginners-and-everyone-else" + }] + }' +``` + + + +## Request + +### Parameters + +- No query parameters required + +- No path parameters required + +### Request Body + +```json +{ + "collectionName": "string" +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which entities will be inserted.| +| `data` | **object**(required)
An entity object. Note that the keys in the entity should match the collection schema.| + +```json +{ + "collectionName": "string", + "data": [] +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which entities will be inserted.| +| `data` | **array**(required)
An array of entity objects. Note that the keys in an entity object should match the collection schema| + +## Response + +Returns the number of inserted entities and an array of their IDs. + +### Response Bodies + +- Response body if we process your request successfully + +```json +{ + "code": 200, + "data": { + "insertCount": "integer" + } +} +``` + +- Response body if we failed to process your request + +```json +{ + "code": integer, + "message": string +} +``` + +### Properties + +The properties in the returned response are listed in the following table. + +| Property | Description | +|----------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `code` | **integer**
Indicates whether the request succeeds.
| +| `data` | **object**
A data object. | +| `data.insertCount` | **integer**
The number of inserted entities. | +| `data.insertIds` | **array**
An array of the IDs of inserted entities. | +| `message` | **string**
Indicates the possible reason for the reported error. | + +## Possible Errors + +| Error Code | Description | +| --- | --- | +| 800 | database not found | +| 1800 | user hasn't authenticate | +| 1801 | can only accept json format request | +| 1802 | missing required parameters | +| 1804 | fail to deal the insert data | +| 1806 | please check the primary key and its' type can only in [int | diff --git a/API_Reference/milvus-restful/v2.3.x/Vector Operations/query.md b/API_Reference/milvus-restful/v2.3.x/Vector Operations/query.md new file mode 100644 index 000000000..1f61ddef6 --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/Vector Operations/query.md @@ -0,0 +1,104 @@ +# Query + +Conducts a vector query in a collection. + +
+
+ POST +
+ https://${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/query +
+ +## Example + + +Query entities that meet specific conditions: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/query" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "outputFields": ["id", "title", "link"], + "filter": "id in [443300716234671427, 443300716234671426]", + "limit": 100, + "offset": 0 + }' +``` + + + +## Request + +### Parameters + +- No query parameters required + +- No path parameters required + +### Request Body + +```json +{ + "collectionName": "string", + "filter": "string", + "limit": "integer", + "offset": "integer", + "outputFields": [] +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which this operation applies.| +| `filter` | **string**(required)
The filter used to find matches for the search.| +| `limit` | **integer**
The maximum number of entities to return.
The sum of this value and that of `offset` should be less than **16384**.
The value defaults to **100**.
The value ranges from **1** to **100**.| +| `offset` | **integer**
The number of entities to skip in the search results.
The sum of this value and that of `limit` should be less than **16384**.
The maximum value is **16384**.| +| `outputFields` | **array**
An array of fields to return along with the search results.| + +## Response + +Returns the search results. + +### Response Bodies + +- Response body if we process your request successfully + +```json +{ + "code": 200, + "data": {} +} +``` + +- Response body if we failed to process your request + +```json +{ + "code": integer, + "message": string +} +``` + +### Properties + +The properties in the returned response are listed in the following table. + +| Property | Description | +|----------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `code` | **integer**
Indicates whether the request succeeds.
| +| `data` | **array**
A data array of objects. | +| `message` | **string**
Indicates the possible reason for the reported error. | + +## Possible Errors + +| Error Code | Description | +| --- | --- | +| 800 | database not found | +| 1800 | user hasn't authenticate | +| 1801 | can only accept json format request | +| 1802 | missing required parameters | +| 1805 | fail to parse search result | diff --git a/API_Reference/milvus-restful/v2.3.x/Vector Operations/search.md b/API_Reference/milvus-restful/v2.3.x/Vector Operations/search.md new file mode 100644 index 000000000..5ed55bc5b --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/Vector Operations/search.md @@ -0,0 +1,121 @@ +# Search + +Conducts a similarity search in a collection. + +
+
+ POST +
+ https://${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/search +
+ +## Example + + +Search entities based on a given vector: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/search" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "vector": [0.4882628, 0.85768371, 0.48556888, 0.9681036, 0.94807827, 0.80656861, 0.72123286, 0.81810534, 0.83713905, 0.73258409, 0.97732714, 0.09869599, 0.83189308, 0.33537219, 0.88647192, 0.66132137, 0.703723, 0.34379603, 0.74785059, 0.84559156, 0.65074354, 0.61864253, 0.73546132, 0.84872955, 0.6006182, 0.04830389, 0.37780669, 0.96101751, 0.22319285, 0.88504273, 0.44813016, 0.69746754, 0.5707871, 0.37386075, 0.25382573, 0.42397712, 0.89749552, 0.39729882, 0.38485115, 0.12583234, 0.47243267, 0.74576701, 0.45814588, 0.88024839, 0.72812605, 0.6622232, 0.31803479, 0.74101011, 0.76141925, 0.5024863, 0.47431501, 0.40002184, 0.45752955, 0.54383915, 0.67569667, 0.52164475, 0.33647519, 0.93068322, 0.65766685, 0.95959175, 0.83665213, 0.1753687, 0.27341319, 0.34550907, 0.79669369, 0.95065082, 0.30838918, 0.79784458, 0.37323557, 0.97728813, 0.11170225, 0.87876854, 0.85212036, 0.88599461, 0.76916602, 0.6094099, 0.4427332, 0.87373443, 0.18576099, 0.81970137, 0.74932009, 0.92106027, 0.76417889, 0.35671825, 0.09990157, 0.14570871, 0.43084067, 0.30551776, 0.63985873, 0.45777184, 0.16172334, 0.32226743, 0.27613814, 0.18182943, 0.7019827, 0.45446168, 0.31359211, 0.17426952, 0.19392872, 0.59816543, 0.31679765, 0.60059089, 0.92800561, 0.95165562, 0.55177484, 0.49510178, 0.60250447, 0.1519485, 0.33565446, 0.92865767, 0.86723503, 0.85392181, 0.85337828, 0.01631286, 0.25257909, 0.00124323, 0.59344951, 0.78468014, 0.61854741, 0.61980932, 0.87467147, 0.44361724, 0.97777631, 0.42543721, 0.5290862, 0.12384163, 0.45287003, 0.30333621, 0.10408064, 0.71930918, 0.90741917, 0.09838064, 0.66319033, 0.08133113, 0.30527365, 0.40877414, 0.11552966, 0.76451148, 0.00529968, 0.76741598, 0.90358724, 0.05710312, 0.32659557, 0.66143926, 0.3258203, 0.62721598, 0.18690116, 0.00184847, 0.11355109, 0.33962499, 0.64671448, 0.67297271, 0.02416349, 0.3173442, 0.54041374, 0.33752188, 0.75654937, 0.08236666, 0.40054276, 0.1021504, 0.20874325, 0.75615835, 0.54953906, 0.44659766, 0.16064502, 0.58682242, 0.15547067, 0.57503622, 0.07797247, 0.1559962, 0.94815864, 0.12474807, 0.0999395, 0.85504252, 0.55633022, 0.56959553, 0.75966109, 0.70444125, 0.66884798, 0.81692129, 0.06837097, 0.9714623, 0.86751075, 0.42125912, 0.44367403, 0.49978621, 0.32267559, 0.67220653, 0.56167557, 0.25248436, 0.94191099, 0.71508807, 0.64564731, 0.56824345, 0.29187781, 0.93961505, 0.28196959, 0.92713673, 0.7256734, 0.51042292, 0.81504509, 0.55849401, 0.19380059, 0.46767559, 0.52275063, 0.66075204, 0.97290358, 0.57524932, 0.7219121, 0.85188581, 0.26220385, 0.75686621, 0.51934907, 0.185452, 0.49708297, 0.95783663, 0.61397962, 0.45956795, 0.49311061, 0.49464425, 0.43094667, 0.76768303, 0.29252745, 0.57964633, 0.72950803, 0.94616381, 0.60436868, 0.47828997, 0.90345857, 0.92971537, 0.64784105, 0.18095567, 0.94852017, 0.05224637, 0.50829763, 0.89020778, 0.008269, 0.9500583, 0.20305412, 0.21179052, 0.28443536, 0.39540241, 0.20286982, 0.30968133, 0.2141927, 0.4390286, 0.12686093, 0.59583271, 0.88270185, 0.28187656, 0.90096987, 0.29104497, 0.38480562, 0.40069773, 0.52293091, 0.37621525] + }' +``` + +Search entities and return specific fields: + +```shell +curl --request POST \ + --url "${MILVUS_HOST}:${MILVUS_PORT}/v1/vector/search" \ + --header "Authorization: Bearer ${TOKEN}" \ + --header "accept: application/json" \ + --header "content-type: application/json" \ + -d '{ + "collectionName": "medium_articles", + "outputFields": ["id", "title", "link", "distance"], + "vector": [0.4882628, 0.85768371, 0.48556888, 0.9681036, 0.94807827, 0.80656861, 0.72123286, 0.81810534, 0.83713905, 0.73258409, 0.97732714, 0.09869599, 0.83189308, 0.33537219, 0.88647192, 0.66132137, 0.703723, 0.34379603, 0.74785059, 0.84559156, 0.65074354, 0.61864253, 0.73546132, 0.84872955, 0.6006182, 0.04830389, 0.37780669, 0.96101751, 0.22319285, 0.88504273, 0.44813016, 0.69746754, 0.5707871, 0.37386075, 0.25382573, 0.42397712, 0.89749552, 0.39729882, 0.38485115, 0.12583234, 0.47243267, 0.74576701, 0.45814588, 0.88024839, 0.72812605, 0.6622232, 0.31803479, 0.74101011, 0.76141925, 0.5024863, 0.47431501, 0.40002184, 0.45752955, 0.54383915, 0.67569667, 0.52164475, 0.33647519, 0.93068322, 0.65766685, 0.95959175, 0.83665213, 0.1753687, 0.27341319, 0.34550907, 0.79669369, 0.95065082, 0.30838918, 0.79784458, 0.37323557, 0.97728813, 0.11170225, 0.87876854, 0.85212036, 0.88599461, 0.76916602, 0.6094099, 0.4427332, 0.87373443, 0.18576099, 0.81970137, 0.74932009, 0.92106027, 0.76417889, 0.35671825, 0.09990157, 0.14570871, 0.43084067, 0.30551776, 0.63985873, 0.45777184, 0.16172334, 0.32226743, 0.27613814, 0.18182943, 0.7019827, 0.45446168, 0.31359211, 0.17426952, 0.19392872, 0.59816543, 0.31679765, 0.60059089, 0.92800561, 0.95165562, 0.55177484, 0.49510178, 0.60250447, 0.1519485, 0.33565446, 0.92865767, 0.86723503, 0.85392181, 0.85337828, 0.01631286, 0.25257909, 0.00124323, 0.59344951, 0.78468014, 0.61854741, 0.61980932, 0.87467147, 0.44361724, 0.97777631, 0.42543721, 0.5290862, 0.12384163, 0.45287003, 0.30333621, 0.10408064, 0.71930918, 0.90741917, 0.09838064, 0.66319033, 0.08133113, 0.30527365, 0.40877414, 0.11552966, 0.76451148, 0.00529968, 0.76741598, 0.90358724, 0.05710312, 0.32659557, 0.66143926, 0.3258203, 0.62721598, 0.18690116, 0.00184847, 0.11355109, 0.33962499, 0.64671448, 0.67297271, 0.02416349, 0.3173442, 0.54041374, 0.33752188, 0.75654937, 0.08236666, 0.40054276, 0.1021504, 0.20874325, 0.75615835, 0.54953906, 0.44659766, 0.16064502, 0.58682242, 0.15547067, 0.57503622, 0.07797247, 0.1559962, 0.94815864, 0.12474807, 0.0999395, 0.85504252, 0.55633022, 0.56959553, 0.75966109, 0.70444125, 0.66884798, 0.81692129, 0.06837097, 0.9714623, 0.86751075, 0.42125912, 0.44367403, 0.49978621, 0.32267559, 0.67220653, 0.56167557, 0.25248436, 0.94191099, 0.71508807, 0.64564731, 0.56824345, 0.29187781, 0.93961505, 0.28196959, 0.92713673, 0.7256734, 0.51042292, 0.81504509, 0.55849401, 0.19380059, 0.46767559, 0.52275063, 0.66075204, 0.97290358, 0.57524932, 0.7219121, 0.85188581, 0.26220385, 0.75686621, 0.51934907, 0.185452, 0.49708297, 0.95783663, 0.61397962, 0.45956795, 0.49311061, 0.49464425, 0.43094667, 0.76768303, 0.29252745, 0.57964633, 0.72950803, 0.94616381, 0.60436868, 0.47828997, 0.90345857, 0.92971537, 0.64784105, 0.18095567, 0.94852017, 0.05224637, 0.50829763, 0.89020778, 0.008269, 0.9500583, 0.20305412, 0.21179052, 0.28443536, 0.39540241, 0.20286982, 0.30968133, 0.2141927, 0.4390286, 0.12686093, 0.59583271, 0.88270185, 0.28187656, 0.90096987, 0.29104497, 0.38480562, 0.40069773, 0.52293091, 0.37621525], + "filter": "id in [443300716234671427, 443300716234671426]", + "limit": 100, + "offset": 0 + }' +``` + + + +## Request + +### Parameters + +- No query parameters required + +- No path parameters required + +### Request Body + +```json +{ + "collectionName": "string", + "filter": "string", + "limit": "integer", + "offset": "integer", + "outputFields": [], + "vector": [] +} +``` + +| Parameter | Description | +|------------------|-------------------------------------------------------------------------------------------| +| `collectionName` | **string**(required)
The name of the collection to which this operation applies.| +| `filter` | **string**
The filter used to find matches for the search| +| `limit` | **integer**
The maximum number of entities to return.
The sum of this value of that of `offset` should be less than **1024**.
The value defaults to **100**.
The value ranges from **1** to **100**.| +| `offset` | **integer**
The number of entities to skip in the search results.
The sum of this value and that of `limit` should not be greater than **1024**.
The maximum value is **1024**.| +| `outputFields` | **array**
An array of fields to return along with the search results.| +| `vector` | **array (number \[float32\])**(required)
The query vector in the form of a list of floating numbers.| + +## Response + +Returns the search results. + +### Response Bodies + +- Response body if we process your request successfully + +```json +{ + "code": 200, + "data": {} +} +``` + +- Response body if we failed to process your request + +```json +{ + "code": integer, + "message": string +} +``` + +### Properties + +The properties in the returned response are listed in the following table. + +| Property | Description | +|----------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `code` | **integer**
Indicates whether the request succeeds.
| +| `data` | **array**
A data array of objects. | +| `message` | **string**
Indicates the possible reason for the reported error. | + +## Possible Errors + +| Error Code | Description | +| --- | --- | +| 800 | database not found | +| 1800 | user hasn't authenticate | +| 1801 | can only accept json format request | +| 1802 | missing required parameters | +| 1805 | fail to parse search result | diff --git a/API_Reference/milvus-restful/v2.3.x/clean.json b/API_Reference/milvus-restful/v2.3.x/clean.json new file mode 100644 index 000000000..75357040a --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/clean.json @@ -0,0 +1,1300 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "API Reference", + "description": "OpenAPI for operations on Zilliz Cloud", + "version": "1.0.0" + }, + "tags": [ + { + "name": "Collection Operations" + }, + { + "name": "Vector Operations" + } + ], + "paths": { + "/v1/vector/collections": { + "get": { + "summary": "List Collections", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Lists collections in a cluster.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Returns a list of collections in the specified cluster.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767175-run" + } + }, + "/v1/vector/collections/create": { + "post": { + "summary": "Create Collection", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Creates a collection in a cluster.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "dbName": { + "type": "string", + "description": "The name of the database to which the collection to create belongs to. This parameter applies only to dedicated clusters." + }, + "collectionName": { + "type": "string", + "description": "The name of the collection to create." + }, + "dimension": { + "type": "integer", + "description": "The number of dimensions for the vector field of the collection.", + "minimum": 32, + "maximum": 32768 + }, + "metricType": { + "type": "string", + "description": "The distance metric used for the collection.", + "default": "L2" + }, + "primaryField": { + "type": "string", + "description": "The primary key field.", + "default": "id" + }, + "vectorField": { + "type": "string", + "description": "The vector field.", + "default": "vector" + }, + "description": { + "type": "string", + "description": "The description of the collection" + } + }, + "required": [ + "collectionName", + "dimension" + ], + "x-apifox-orders": [ + "dbName", + "collectionName", + "dimension", + "metricType", + "primaryField", + "vectorField", + "description" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + }, + "responses": { + "200": { + "description": "Returns an empty object.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767176-run" + } + }, + "/v1/vector/collections/describe": { + "get": { + "summary": "Describe Collection", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Describes the details of a collection.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "collectionName", + "in": "query", + "description": "The name of the collection to describe.", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Returns the specified collection in detail.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection." + }, + "description": { + "type": "string", + "description": "An optional description of the collection." + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "autoId": { + "type": "boolean", + "description": "Whether the primary key automatically increments." + }, + "description": { + "type": "string", + "description": "An optional description of the field." + }, + "name": { + "type": "string", + "description": "The name of the field." + }, + "primaryKey": { + "type": "boolean", + "description": "Whether the field is a primary field." + }, + "type": { + "type": "string", + "description": "The data type of the values in this field." + } + }, + "x-apifox-orders": [ + "autoId", + "description", + "name", + "primaryKey", + "type" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "description": "An field array" + }, + "indexes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fieldName": { + "type": "string", + "description": "The name of the indexed field." + }, + "indexName": { + "type": "string", + "description": "The name of the generated index files." + }, + "metricType": { + "type": "string", + "description": "The metric type used in the index process." + } + }, + "x-apifox-orders": [ + "fieldName", + "indexName", + "metricType" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "description": "An index array" + }, + "load": { + "type": "string", + "description": "The load status of the collection. Possible values are **unload**, **loading**, and **loaded**." + }, + "shardsNum": { + "type": "integer", + "description": "The number of shards in the collection." + }, + "enableDynamicField": { + "type": "boolean", + "description": "Whether the dynamic JSON feature is enabled for this collection." + } + }, + "x-apifox-orders": [ + "collectionName", + "description", + "fields", + "indexes", + "load", + "shardsNum", + "enableDynamicField" + ], + "required": [ + "enableDynamicField" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767177-run" + } + }, + "/v1/vector/collections/drop": { + "post": { + "summary": "Drop Collection", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Drops a collection. This operation erases your collection data. Exercise caution when performing this operation.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to delete." + } + }, + "x-apifox-orders": [ + "collectionName" + ], + "required": [ + "collectionName" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + }, + "responses": { + "200": { + "description": "Returns an empty object.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767178-run" + } + }, + "/v1/vector/delete": { + "post": { + "summary": "Delete", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Deletes one or more entities from a collection.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "string", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "integer", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Returns an empty object.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767179-run" + } + }, + "/v1/vector/insert": { + "post": { + "summary": "Insert", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Inserts one or more entities into a collection.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "x-apifox-orders": [ + "collectionName", + "data" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which entities will be inserted." + }, + "data": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "description": "An entity object. Note that the keys in the entity should match the collection schema.", + "x-apifox-ignore-properties": [] + } + }, + "required": [ + "collectionName", + "data" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "required": [ + "data", + "collectionName" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which entities will be inserted." + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [] + }, + "description": "An array of entity objects. Note that the keys in an entity object should match the collection schema" + } + }, + "x-apifox-orders": [ + "collectionName", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Returns the number of inserted entities and an array of their IDs.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "properties": { + "insertCount": { + "type": "integer", + "description": "The number of inserted entities." + }, + "insertIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of the IDs of inserted entities." + } + }, + "x-apifox-orders": [ + "insertCount", + "insertIds" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767180-run" + } + }, + "/v1/vector/search": { + "post": { + "summary": "Search", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Conducts a similarity search in a collection. ", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "x-apifox-refs": { + "01H1PFY2ZE8WYR08AGKW1MBY8M": { + "x-apifox-overrides": { + "level": { + "type": "integer", + "description": "The precision level of the results can be adjusted using values **1**, **2**, or **3**. Higher precision levels lead to more accurate results but take longer to compute. The default value is 1, which prioritizes speed over accuracy.", + "default": 1 + } + }, + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search" + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value of that of `offset` should be less than **1024**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should not be greater than **1024**.", + "minimum": 0, + "maximum": 1024, + "exclusiveMinimum": true + }, + "outputFields": { + "type": "array", + "items": { + "type": "string", + "default": "id, distance" + }, + "description": "An array of fields to return along with the search results." + }, + "vector": { + "type": "array", + "items": { + "type": "number", + "format": "float32" + }, + "description": "The query vector in the form of a list of floating numbers." + } + }, + "x-apifox-orders": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields", + "vector" + ], + "required": [ + "collectionName", + "vector" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "01H1PFY2ZE8WYR08AGKW1MBY8M" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search" + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value of that of `offset` should be less than **1024**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should not be greater than **1024**.", + "minimum": 0, + "maximum": 1024, + "exclusiveMinimum": true + }, + "outputFields": { + "type": "array", + "items": { + "type": "string", + "default": "id, distance" + }, + "description": "An array of fields to return along with the search results." + }, + "vector": { + "type": "array", + "items": { + "type": "number", + "format": "float32" + }, + "description": "The query vector in the form of a list of floating numbers." + } + }, + "required": [ + "collectionName", + "vector" + ], + "x-apifox-ignore-properties": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields", + "vector" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Returns the search results.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "x-apifox-ignore-properties": [] + } + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [] + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767181-run" + } + }, + "/v1/vector/query": { + "post": { + "summary": "Query", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Conducts a vector query in a collection.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search." + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value and that of `offset` should be less than **16384**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should be less than **16384**.", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 16384 + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + } + }, + "x-apifox-refs": { + "01H0KV6DX6NKH0PHSNRYW8XD4S": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search." + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value and that of `offset` should be less than **16384**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should be less than **16384**.", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 16384 + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + } + }, + "x-apifox-orders": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields" + ], + "required": [ + "collectionName", + "filter" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "01H0KV6DX6NKH0PHSNRYW8XD4S" + ], + "required": [ + "collectionName", + "filter" + ], + "x-apifox-ignore-properties": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields" + ] + } + } + } + }, + "responses": { + "200": { + "description": "Returns the search results.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "x-apifox-ignore-properties": [] + } + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [] + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-82167294-run" + } + }, + "/v1/vector/get": { + "post": { + "summary": "Get", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Gets entities by the specified IDs.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "string", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + { + "type": "object", + "x-apifox-refs": { + "01H0KWBZQSHZ451Z4A9YQ9WQTA": { + "x-apifox-overrides": { + "id": { + "type": "integer", + "description": "The ID of entity to be retrieved" + } + }, + "required": [ + "id" + ], + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "integer", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "01H0KWBZQSHZ451Z4A9YQ9WQTA" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "integer", + "description": "The ID of entity to be retrieved" + } + }, + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [ + "collectionName", + "outputFields", + "id" + ] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "Returns the search results.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "x-apifox-ignore-properties": [] + } + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [] + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-82172081-run" + } + } + }, + "servers": [] +} \ No newline at end of file diff --git a/API_Reference/milvus-restful/v2.3.x/openapi.json b/API_Reference/milvus-restful/v2.3.x/openapi.json new file mode 100644 index 000000000..e2bd817f0 --- /dev/null +++ b/API_Reference/milvus-restful/v2.3.x/openapi.json @@ -0,0 +1,2121 @@ +{ + "openapi": "3.0.1", + "info": { + "title": "Restful API", + "description": "", + "version": "1.0.0" + }, + "tags": [ + { + "name": "Collection Operations" + }, + { + "name": "Vector Operations" + } + ], + "paths": { + "/v1/vector/collections": { + "get": { + "summary": "List Collections", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Lists collections in a cluster.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "example": "", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Returns a list of collections in the specified cluster.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767175-run" + } + }, + "/v1/vector/collections/create": { + "post": { + "summary": "Create Collection", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Creates a collection in a cluster.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "dbName": { + "type": "string", + "description": "The name of the database to which the collection to create belongs to. This parameter applies only to dedicated clusters." + }, + "collectionName": { + "type": "string", + "description": "The name of the collection to create." + }, + "dimension": { + "type": "integer", + "description": "The number of dimensions for the vector field of the collection.", + "minimum": 32, + "maximum": 32768 + }, + "metricType": { + "type": "string", + "description": "The distance metric used for the collection.", + "default": "L2" + }, + "primaryField": { + "type": "string", + "description": "The primary key field.", + "default": "id" + }, + "vectorField": { + "type": "string", + "description": "The vector field.", + "default": "vector" + }, + "description": { + "type": "string", + "description": "The description of the collection" + } + }, + "required": [ + "collectionName", + "dimension" + ], + "x-apifox-orders": [ + "dbName", + "collectionName", + "dimension", + "metricType", + "primaryField", + "vectorField", + "description" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns an empty object.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767176-run" + } + }, + "/v1/vector/collections/describe": { + "get": { + "summary": "Describe Collection", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Describes the details of a collection.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "collectionName", + "in": "query", + "description": "The name of the collection to describe.", + "required": true, + "example": "", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Returns the specified collection in detail.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection." + }, + "description": { + "type": "string", + "description": "An optional description of the collection." + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "autoId": { + "type": "boolean", + "description": "Whether the primary key automatically increments." + }, + "description": { + "type": "string", + "description": "An optional description of the field." + }, + "name": { + "type": "string", + "description": "The name of the field." + }, + "primaryKey": { + "type": "boolean", + "description": "Whether the field is a primary field." + }, + "type": { + "type": "string", + "description": "The data type of the values in this field." + } + }, + "x-apifox-orders": [ + "autoId", + "description", + "name", + "primaryKey", + "type" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "description": "An field array" + }, + "indexes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fieldName": { + "type": "string", + "description": "The name of the indexed field." + }, + "indexName": { + "type": "string", + "description": "The name of the generated index files." + }, + "metricType": { + "type": "string", + "description": "The metric type used in the index process." + } + }, + "x-apifox-orders": [ + "fieldName", + "indexName", + "metricType" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "description": "An index array" + }, + "load": { + "type": "string", + "description": "The load status of the collection. Possible values are **unload**, **loading**, and **loaded**." + }, + "shardsNum": { + "type": "integer", + "description": "The number of shards in the collection." + }, + "enableDynamicField": { + "type": "boolean", + "description": "Whether the dynamic JSON feature is enabled for this collection." + } + }, + "x-apifox-orders": [ + "collectionName", + "description", + "fields", + "indexes", + "load", + "shardsNum", + "enableDynamicField" + ], + "required": [ + "enableDynamicField" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767177-run" + } + }, + "/v1/vector/collections/drop": { + "post": { + "summary": "Drop Collection", + "x-apifox-folder": "Collection Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Drops a collection. This operation erases your collection data. Exercise caution when performing this operation.", + "tags": [ + "Collection Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to delete." + } + }, + "x-apifox-orders": [ + "collectionName" + ], + "required": [ + "collectionName" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns an empty object.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767178-run" + } + }, + "/v1/vector/delete": { + "post": { + "summary": "Delete", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Deletes one or more entities from a collection.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "string", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "integer", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "id": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "collectionName", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [] + } + ] + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns an empty object.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767179-run" + } + }, + "/v1/vector/insert": { + "post": { + "summary": "Insert", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Inserts one or more entities into a collection.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "additionalProperties": false, + "x-apifox-orders": [ + "collectionName", + "data" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which entities will be inserted." + }, + "data": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "description": "An entity object. Note that the keys in the entity should match the collection schema.", + "x-apifox-ignore-properties": [] + } + }, + "required": [ + "collectionName", + "data" + ], + "x-apifox-ignore-properties": [] + }, + { + "type": "object", + "required": [ + "data", + "collectionName" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which entities will be inserted." + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [] + }, + "description": "An array of entity objects. Note that the keys in an entity object should match the collection schema" + } + }, + "x-apifox-orders": [ + "collectionName", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + ] + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns the number of inserted entities and an array of their IDs.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "properties": { + "insertCount": { + "type": "integer", + "examples": [ + 4 + ], + "description": "The number of inserted entities." + }, + "insertIds": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "['id1'", + " 'id2'", + " 'id3']" + ] + ], + "description": "An array of the IDs of inserted entities." + } + }, + "x-apifox-orders": [ + "insertCount", + "insertIds" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767180-run" + } + }, + "/v1/vector/search": { + "post": { + "summary": "Search", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Conducts a similarity search in a collection. ", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "x-apifox-refs": { + "01H1PFY2ZE8WYR08AGKW1MBY8M": { + "x-apifox-overrides": { + "level": { + "type": "integer", + "description": "The precision level of the results can be adjusted using values **1**, **2**, or **3**. Higher precision levels lead to more accurate results but take longer to compute. The default value is 1, which prioritizes speed over accuracy.", + "default": 1 + } + }, + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search" + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value of that of `offset` should be less than **1024**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should not be greater than **1024**.", + "minimum": 0, + "maximum": 1024, + "exclusiveMinimum": true + }, + "outputFields": { + "type": "array", + "items": { + "type": "string", + "default": "id, distance" + }, + "description": "An array of fields to return along with the search results." + }, + "vector": { + "type": "array", + "items": { + "type": "number", + "format": "float32" + }, + "description": "The query vector in the form of a list of floating numbers." + } + }, + "x-apifox-orders": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields", + "vector" + ], + "required": [ + "collectionName", + "vector" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "01H1PFY2ZE8WYR08AGKW1MBY8M" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search" + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value of that of `offset` should be less than **1024**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should not be greater than **1024**.", + "minimum": 0, + "maximum": 1024, + "exclusiveMinimum": true + }, + "outputFields": { + "type": "array", + "items": { + "type": "string", + "default": "id, distance" + }, + "description": "An array of fields to return along with the search results." + }, + "vector": { + "type": "array", + "items": { + "type": "number", + "format": "float32" + }, + "description": "The query vector in the form of a list of floating numbers." + } + }, + "required": [ + "collectionName", + "vector" + ], + "x-apifox-ignore-properties": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields", + "vector" + ] + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns the search results.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "x-apifox-ignore-properties": [] + } + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [] + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-77767181-run" + } + }, + "/v1/vector/query": { + "post": { + "summary": "Query", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Conducts a vector query in a collection.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search." + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value and that of `offset` should be less than **16384**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should be less than **16384**.", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 16384 + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + } + }, + "x-apifox-refs": { + "01H0KV6DX6NKH0PHSNRYW8XD4S": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search." + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value and that of `offset` should be less than **16384**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should be less than **16384**.", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 16384 + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + } + }, + "x-apifox-orders": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields" + ], + "required": [ + "collectionName", + "filter" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "01H0KV6DX6NKH0PHSNRYW8XD4S" + ], + "required": [ + "collectionName", + "filter" + ], + "x-apifox-ignore-properties": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields" + ] + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns the search results.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "x-apifox-ignore-properties": [] + } + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [] + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-82167294-run" + } + }, + "/v1/vector/get": { + "post": { + "summary": "Get", + "x-apifox-folder": "Vector Operations", + "x-apifox-status": "released", + "deprecated": false, + "description": "Gets entities by the specified IDs.", + "tags": [ + "Vector Operations" + ], + "parameters": [ + { + "name": "public-endpoint", + "in": "path", + "description": "", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "oneOf": [ + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "string", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + { + "type": "object", + "x-apifox-refs": { + "01H0KWBZQSHZ451Z4A9YQ9WQTA": { + "x-apifox-overrides": { + "id": { + "type": "integer", + "description": "The ID of entity to be retrieved" + } + }, + "required": [ + "id" + ], + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "integer", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "01H0KWBZQSHZ451Z4A9YQ9WQTA" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "integer", + "description": "The ID of entity to be retrieved" + } + }, + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [ + "collectionName", + "outputFields", + "id" + ] + }, + { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + ] + }, + "example": "" + } + } + }, + "responses": { + "200": { + "description": "Returns the search results.", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "object", + "properties": {}, + "x-apifox-orders": [], + "x-apifox-ignore-properties": [] + } + } + }, + "x-apifox-refs": {}, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [] + } + } + } + } + }, + "x-run-in-apifox": "https://www.apifox.cn/web/project/2645146/apis/api-82172081-run" + } + } + }, + "components": { + "schemas": { + "customer.GetReq4": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.GetReq3": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "integer", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.GetReq2": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of IDs of the entities to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.GetReq1": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + }, + "id": { + "type": "string", + "description": "The ID of the entity to be retrieved" + } + }, + "x-apifox-orders": [ + "collectionName", + "outputFields", + "id" + ], + "required": [ + "collectionName", + "id" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.QueryReq": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search." + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value and that of `offset` should be less than **16384**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should be less than **16384**.", + "minimum": 0, + "exclusiveMinimum": true, + "maximum": 16384 + }, + "outputFields": { + "type": "array", + "items": { + "type": "string" + }, + "description": "An array of fields to return along with the search results." + } + }, + "x-apifox-orders": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields" + ], + "required": [ + "collectionName", + "filter" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.SearchOrQueryReq": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which this operation applies." + }, + "filter": { + "type": "string", + "description": "The filter used to find matches for the search" + }, + "limit": { + "type": "integer", + "description": "The maximum number of entities to return.
The sum of this value of that of `offset` should be less than **1024**.", + "default": 100, + "minimum": 1, + "maximum": 100 + }, + "offset": { + "type": "integer", + "description": "The number of entities to skip in the search results.
The sum of this value and that of `limit` should not be greater than **1024**.", + "minimum": 0, + "maximum": 1024, + "exclusiveMinimum": true + }, + "outputFields": { + "type": "array", + "items": { + "type": "string", + "default": "id, distance" + }, + "description": "An array of fields to return along with the search results." + }, + "vector": { + "type": "array", + "items": { + "type": "number", + "format": "float32" + }, + "description": "The query vector in the form of a list of floating numbers." + } + }, + "x-apifox-orders": [ + "collectionName", + "filter", + "limit", + "offset", + "outputFields", + "vector" + ], + "required": [ + "collectionName", + "vector" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_InsertResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "properties": { + "insertCount": { + "type": "integer", + "examples": [ + 4 + ], + "description": "The number of inserted entities." + }, + "insertIds": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "['id1'", + " 'id2'", + " 'id3']" + ] + ], + "description": "An array of the IDs of inserted entities." + } + }, + "x-apifox-orders": [ + "insertCount", + "insertIds" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.InsertResp": { + "type": "object", + "properties": { + "insertCount": { + "type": "integer", + "examples": [ + 4 + ], + "description": "The number of inserted entities." + }, + "insertIds": { + "type": "array", + "items": { + "type": "string" + }, + "examples": [ + [ + "['id1'", + " 'id2'", + " 'id3']" + ] + ], + "description": "An array of the IDs of inserted entities." + } + }, + "x-apifox-orders": [ + "insertCount", + "insertIds" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.InsertReq": { + "type": "object", + "required": [ + "data", + "collectionName" + ], + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to which entities will be inserted." + }, + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true, + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [] + }, + "description": "An array of entity objects. Note that the keys in an entity object should match the collection schema" + } + }, + "x-apifox-orders": [ + "collectionName", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_DeleteResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DeleteResp": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_DropCollectionResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DropCollectionResp": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DropCollectionReq": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection to delete." + } + }, + "x-apifox-orders": [ + "collectionName" + ], + "required": [ + "collectionName" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_DescCollectionResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection." + }, + "description": { + "type": "string", + "description": "An optional description of the collection." + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "autoId": { + "type": "boolean", + "description": "Whether the primary key automatically increments." + }, + "description": { + "type": "string", + "description": "An optional description of the field." + }, + "name": { + "type": "string", + "description": "The name of the field." + }, + "primaryKey": { + "type": "boolean", + "description": "Whether the field is a primary field." + }, + "type": { + "type": "string", + "description": "The data type of the values in this field." + } + }, + "x-apifox-orders": [ + "autoId", + "description", + "name", + "primaryKey", + "type" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "description": "An field array" + }, + "indexes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fieldName": { + "type": "string", + "description": "The name of the indexed field." + }, + "indexName": { + "type": "string", + "description": "The name of the generated index files." + }, + "metricType": { + "type": "string", + "description": "The metric type used in the index process." + } + }, + "x-apifox-orders": [ + "fieldName", + "indexName", + "metricType" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "description": "An index array" + }, + "load": { + "type": "string", + "description": "The load status of the collection. Possible values are **unload**, **loading**, and **loaded**." + }, + "shardsNum": { + "type": "integer", + "description": "The number of shards in the collection." + }, + "enableDynamicField": { + "type": "boolean", + "description": "Whether the dynamic JSON feature is enabled for this collection." + } + }, + "x-apifox-orders": [ + "collectionName", + "description", + "fields", + "indexes", + "load", + "shardsNum", + "enableDynamicField" + ], + "required": [ + "enableDynamicField" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DescCollectionResp": { + "type": "object", + "properties": { + "collectionName": { + "type": "string", + "description": "The name of the collection." + }, + "description": { + "type": "string", + "description": "An optional description of the collection." + }, + "fields": { + "type": "array", + "items": { + "type": "object", + "properties": { + "autoId": { + "type": "boolean", + "description": "Whether the primary key automatically increments." + }, + "description": { + "type": "string", + "description": "An optional description of the field." + }, + "name": { + "type": "string", + "description": "The name of the field." + }, + "primaryKey": { + "type": "boolean", + "description": "Whether the field is a primary field." + }, + "type": { + "type": "string", + "description": "The data type of the values in this field." + } + }, + "x-apifox-orders": [ + "autoId", + "description", + "name", + "primaryKey", + "type" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "description": "An field array" + }, + "indexes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "fieldName": { + "type": "string", + "description": "The name of the indexed field." + }, + "indexName": { + "type": "string", + "description": "The name of the generated index files." + }, + "metricType": { + "type": "string", + "description": "The metric type used in the index process." + } + }, + "x-apifox-orders": [ + "fieldName", + "indexName", + "metricType" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "description": "An index array" + }, + "load": { + "type": "string", + "description": "The load status of the collection. Possible values are **unload**, **loading**, and **loaded**." + }, + "shardsNum": { + "type": "integer", + "description": "The number of shards in the collection." + }, + "enableDynamicField": { + "type": "boolean", + "description": "Whether the dynamic JSON feature is enabled for this collection." + } + }, + "x-apifox-orders": [ + "collectionName", + "description", + "fields", + "indexes", + "load", + "shardsNum", + "enableDynamicField" + ], + "required": [ + "enableDynamicField" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DescIndex": { + "type": "object", + "properties": { + "fieldName": { + "type": "string", + "description": "The name of the indexed field." + }, + "indexName": { + "type": "string", + "description": "The name of the generated index files." + }, + "metricType": { + "type": "string", + "description": "The metric type used in the index process." + } + }, + "x-apifox-orders": [ + "fieldName", + "indexName", + "metricType" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.DescField": { + "type": "object", + "properties": { + "autoId": { + "type": "boolean", + "description": "Whether the primary key automatically increments." + }, + "description": { + "type": "string", + "description": "An optional description of the field." + }, + "name": { + "type": "string", + "description": "The name of the field." + }, + "primaryKey": { + "type": "boolean", + "description": "Whether the field is a primary field." + }, + "type": { + "type": "string", + "description": "The data type of the values in this field." + } + }, + "x-apifox-orders": [ + "autoId", + "description", + "name", + "primaryKey", + "type" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_CreateIndexResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "customer.CreateIndexResp": { + "type": "object", + "x-apifox-orders": [], + "properties": {}, + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "CollectionCreateSimple": { + "type": "object", + "properties": { + "dbName": { + "type": "string", + "description": "The name of the database to which the collection to create belongs to. This parameter applies only to dedicated clusters." + }, + "collectionName": { + "type": "string", + "description": "The name of the collection to create." + }, + "dimension": { + "type": "integer", + "description": "The number of dimensions for the vector field of the collection.", + "minimum": 32, + "maximum": 32768 + }, + "metricType": { + "type": "string", + "description": "The distance metric used for the collection.", + "default": "L2" + }, + "primaryField": { + "type": "string", + "description": "The primary key field.", + "default": "id" + }, + "vectorField": { + "type": "string", + "description": "The vector field.", + "default": "vector" + }, + "description": { + "type": "string", + "description": "The description of the collection" + } + }, + "required": [ + "collectionName", + "dimension" + ], + "x-apifox-orders": [ + "dbName", + "collectionName", + "dimension", + "metricType", + "primaryField", + "vectorField", + "description" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + }, + "httpapi.GenericResp-customer_ListCollectionsResp": { + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "x-apifox-orders": [ + "code", + "data" + ], + "x-apifox-ignore-properties": [], + "x-apifox-folder": "Schemas" + } + } + }, + "servers": [] +} \ No newline at end of file diff --git a/API_Reference/milvus-sdk-go/v2.3.x/About.md b/API_Reference/milvus-sdk-go/v2.3.x/About.md index bc6d20ac1..4c5332b9a 100644 --- a/API_Reference/milvus-sdk-go/v2.3.x/About.md +++ b/API_Reference/milvus-sdk-go/v2.3.x/About.md @@ -10,7 +10,7 @@ Milvus GO SDK is an open-source project and its source code is hosted on [GitHub | 1.1.x | [1.1.0](https://github.com/milvus-io/milvus-sdk-go/tree/v1.1.0) | | 2.0.x | [2.0.0](https://github.com/milvus-io/milvus-sdk-go/tree/v2.0.0)| | 2.1.x | [2.1.2](https://github.com/milvus-io/milvus-sdk-go/tree/v2.1.2)| -| 2.2.x | [2.2.6](https://github.com/milvus-io/milvus-sdk-go/tree/v2.2.6)| +| 2.2.x | [2.2.7](https://github.com/milvus-io/milvus-sdk-go/tree/v2.2.7)| Note: Milvus and GO SDK are NOT compatible across major versions. diff --git a/API_Reference/milvus-sdk-java/v2.3.x/About.md b/API_Reference/milvus-sdk-java/v2.3.x/About.md new file mode 100644 index 000000000..8b3ddd4bc --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/About.md @@ -0,0 +1,36 @@ +# About Milvus Java SDK + +Milvus Java SDK is an open-source project and its source code is hosted on [GitHub](https://github.com/milvus-io/milvus-sdk-java). + +## Compatibility + +| Milvus version | Recommended SDK version | +| -------------- | ----------------------- | +| 2.0.2 | 2.0.4 | +| 2.1.0 | 2.1.0 | +| 2.2.0 | 2.2.10 | +| 2.3.0 | 2.3.0 | + +## Installation + +You can use [Apache Maven](https://maven.apache.org/install.html) or [Gradle](https://gradle.org/install/)/[Grails](https://grails.org/download.html) to download the SDK. + +- Apache Maven + +``` + + io.milvus + milvus-sdk-java + 2.3.0 + +``` + +- Gradle/Grails + +``` +compile 'io.milvus:milvus-sdk-java:2.3.0' +``` + +## Contributing + +We are committed to building a collaborative, exuberant open-source community for Milvus. Therefore, contributions to Milvus Java SDK are welcome from everyone. Refer to [Contributing Guideline](https://github.com/milvus-io/milvus-sdk-java/blob/master/CONTRIBUTING.md) before making contributions to this project. You can [file an issue](https://github.com/milvus-io/milvus-sdk-java/issues/new) if you need any assistance or want to propose your ideas. diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Alias/alterAlias().md b/API_Reference/milvus-sdk-java/v2.3.x/Alias/alterAlias().md new file mode 100644 index 000000000..c8390032e --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Alias/alterAlias().md @@ -0,0 +1,54 @@ +# alterAlias() + +A MilvusClient interface. This method alters an alias of a collection to another. + +```Java +R alterAlias(AlterAliasParam requestParam); +``` + +## AlterAliasParam + +Use the `AlterAliasParam.Builder` to construct an `AlterAliasParam` object. + +```Java +import io.milvus.param.AlterAliasParam; +AlterAliasParam.Builder builder = AlterAliasParam.newBuilder(); +``` + +Methods of `AlterAliasParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(String collectionName)` | Sets the target collection name. Collection name cannot be empty or null. | `collectionName`: The name of the collection to alter alias to. | +| `withAlias(String alias)` | Sets the collection alias to alter. Collection alias cannot be empty or null. | `alias`: The alias to alter. | +| `build()` | Constructs a `AlterAliasParam` object. | N/A | + +The `AlterAliasParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +AlterAliasParam param = AlterAliasParam.newBuilder() + .withCollection("collection1") + .withAlias("alias1") + .build(); +R response = client.alterAlias(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Alias/createAlias().md b/API_Reference/milvus-sdk-java/v2.3.x/Alias/createAlias().md new file mode 100644 index 000000000..ecc484f90 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Alias/createAlias().md @@ -0,0 +1,53 @@ +# createAlias() + +A MilvusClient interface. This method creates an alias for a collection. Alias cannot be duplicated. Same alias cannot be assigned to different collections. Instead, you can specify multiple aliases for each collection. + +```Java +R createAlias(CreateAliasParam requestParam); +``` + +## CreateAliasParam + +Use the `CreateAliasParam.Builder` to construct a `CreateAliasParam` object. + +```Java +import io.milvus.param.CreateAliasParam; +CreateAliasParam.Builder builder = CreateAliasParam.newBuilder(); +``` + +Methods of `CreateAliasParam.Builder`: + +| Method | Description | Parameters | +| -------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName( String collectionName)` | Sets the target collection name. Collection name cannot be empty or null. | `collectionName`: The name of the collection to create an alias for. | +| `withAlias(String alias)` | Sets the collection alias. Collection alias cannot be empty or null. | `alias`: The alias to create for the target collection. | +| `build()` | Constructs a `CreateAliasParam` object. | N/A | + +`CreateAliasParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +CreateAliasParam param = CreateAliasParam.newBuilder() + .withCollectionName("collection1") + .withAlias("alias1") + .build(); +R response = client.createAlias(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Alias/dropAlias().md b/API_Reference/milvus-sdk-java/v2.3.x/Alias/dropAlias().md new file mode 100644 index 000000000..47196234d --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Alias/dropAlias().md @@ -0,0 +1,51 @@ +# dropAlias() + +A MilvusClient interface. This method drops an alias for the specified collection. + +```Java +R dropAlias(DropAliasParam requestParam); +``` + +## DropAliasParam + +Use the `DropAliasParam.Builder` to construct a `DropAliasParam` object. + +```Java +import io.milvus.param.DropAliasParam; +DropAliasParam.Builder builder = DropAliasParam.newBuilder(); +``` + +Methods of `DropAliasParam.Builder`: + +| Method | Description | Parameters | +| ------------------------- | ------------------------------------------------------------ | --------------------------- | +| `withAlias(String alias)` | Sets the collection alias. The alias cannot be empty or null. | `alias`: The alias to drop. | +| `build()` | Constructs a `DropAliasParam` object. | N/A | + +The `DropAliasParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +DropAliasParam param = DropAliasParam.newBuilder() + .withAlias("alias1") + .build(); +R response = client.dropAlias(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Authentication/createCredential().md b/API_Reference/milvus-sdk-java/v2.3.x/Authentication/createCredential().md new file mode 100644 index 000000000..0a053eff7 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Authentication/createCredential().md @@ -0,0 +1,54 @@ +# createCredential() + +A MilvusClient interface. This method creates an authenticated user access. + +```Java +R createCredential(CreateCredentialParam requestParam); +``` + +## CreateCredentialParam + +Use the `CreateCredentialParam.Builder` to construct a `CreateCredentialParam` object. + +```Java +import io.milvus.param.CreateCredentialParam; +CreateCredentialParam.Builder builder = CreateCredentialParam.newBuilder(); +``` + +Methods of `CreateCredentialParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------- | ---------------------------------------------------- | ------------------------------------------------------------ | +| `withUsername(String username)` | Sets the username. The username cannot be empty or null. | `username`: The username used to create the credential. | +| `withPassword(String password)` | Sets the password. The password cannot be empty or null. | `password`: The corresponding password used to create the credential. | +| `build()` | Constructs a `CreateCredentialParam` object. | N/A | + +The `CreateCredentialParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +CreateCredentialParam param = CreateCredentialParam.newBuilder() + .withUsername("user") + .withPassword("password") + .build(); +R response = client.createCredential(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Authentication/deleteCredential().md b/API_Reference/milvus-sdk-java/v2.3.x/Authentication/deleteCredential().md new file mode 100644 index 000000000..886288e37 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Authentication/deleteCredential().md @@ -0,0 +1,51 @@ +# deleteCredential() + +A MilvusClient interface. This method deletes an authenticated user access. + +```Java +R deleteCredential(DeleteCredentialParam requestParam); +``` + +## DeleteCredentialParam + +Use the `DeleteCredentialParam.Builder` to construct a `DeleteCredentialParam` object. + +```Java +import io.milvus.param.DeleteCredentialParam; +DeleteCredentialParam.Builder builder = DeleteCredentialParam.newBuilder(); +``` + +Methods of `DeleteCredentialParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------- | ---------------------------------------------------- | ------------------------------------------------------ | +| `withUsername(String username)` | Sets the username. The username cannot be empty or null. | `username`: The username used to delete a credential. | +| `build()` | Constructs a `DeleteCredentialParam` object. | N/A | + +The `DeleteCredentialParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +DeleteCredentialParam param = DeleteCredentialParam.newBuilder() + .withUsername("user") + .build(); +R response = client.deleteCredential(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Authentication/listCredUsers().md b/API_Reference/milvus-sdk-java/v2.3.x/Authentication/listCredUsers().md new file mode 100644 index 000000000..964347c91 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Authentication/listCredUsers().md @@ -0,0 +1,45 @@ +# listCredUsers() + +A MilvusClient interface. This method lists all authenticated user accesses. + +```Java +R listCredUsers(ListCredUsersParam requestParam); +``` + +## ListCredUsersParam + +Use the `ListCredUsersParam.Builder` to construct a `ListCredUsersParam` object. + +```Java +import io.milvus.param.ListCredUsersParam; +ListCredUsersParam.Builder builder = ListCredUsersParam.newBuilder(); +``` + +Methods of `ListCredUsersParam.Builder`: + +| Method | Description | Parameters | +| --------- | ----------------------------------------- | ---------- | +| `build()` | Constructs a `ListCredUsersParam` object. | N/A | + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +ListCredUsersParam param = ListCredUsersParam.newBuilder().build(); +R response = client.listCredUsers(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Authentication/updateCredential().md b/API_Reference/milvus-sdk-java/v2.3.x/Authentication/updateCredential().md new file mode 100644 index 000000000..d3cecfbe2 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Authentication/updateCredential().md @@ -0,0 +1,60 @@ +# updateCredential() + +A MilvusClient interface. This method updates the password of an authenticated user access. The original username and password must be provided when checking the validility of the update operation. + +
+The old connection to the Milvus client can be invalidated after the credential is updated. +
+ + +```Java +R updateCredential(UpdateCredentialParam requestParam); +``` + +## UpdateCredentialParam + +Use the `UpdateCredentialParam.Builder` to construct an `UpdateCredentialParam` object. + +```Java +import io.milvus.param.UpdateCredentialParam; +UpdateCredentialParam.Builder builder = UpdateCredentialParam.newBuilder(); +``` + +Methods of `UpdateCredentialParam.Builder`: + +| Method | Description | Parameters | +| ---------------------------------- | ------------------------------------------------------------ | --------------------------- | +| `withUsername(String username)` | Sets the username. The username cannot be empty or null. | `username`: The username used to reset the password. | +| `withOldPassword(String password)` | Sets the old password. The old password cannot be empty or null. | password: The old password. | +| `withNewPassword(String password)` | Sets the new password. The new password cannot be empty or null. | password: The new password to create for the provided username. | +| `build()` | Constructs a `UpdateCredentialParam` object. | N/A | + +The `UpdateCredentialParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +UpdateCredentialParam param = UpdateCredentialParam.newBuilder() + .withUsername("user") + .withOldPassword("old_password") + .withNewPassword("new_password") + .build(); +R response = client.updateCredential(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/BulkInsert/bulkInsert().md b/API_Reference/milvus-sdk-java/v2.3.x/BulkInsert/bulkInsert().md new file mode 100644 index 000000000..d92459659 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/BulkInsert/bulkInsert().md @@ -0,0 +1,33 @@ +# bulkInsert() + +A MilvusClient interface. This method imports data from external files. Currently, only one JSON file is supported for each call. For details, see [Prepare a JSON File](https://milvus.io/api-reference/pymilvus/v2.2.0/Utility/milvus.io/docs/v2.2.x/bulk_load.md#Prepare-a-JSON-file). + +```Java +R bulkInsert(BulkInsertParam requestParam); +``` + +## BulkInsertParam + +Use the `BulkInsertParam.Builder` to construct a `BulkInsertParam` object. + +```Java +import io.milvus.param.BulkInsertParam; +BulkInsertParam.Builder builder = BulkInsertParam.newBuilder(); +``` + +Methods of `BulkInsertParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withCollectionName(String collectionName)` | Sets the collection name. Collection name cannot be empty or null. | `collectionName`: The name of the target collection. | +| `withPartitionName(String partitionName)`| Sets the partition name. partition name can be null. | `partitionName`: The name of the target partition. | +| `withFiles(List files)` | Sets the path of the files. The paths cannot be empty or null.
Each file path must be a relative path under the Milvus storage bucket. | `files`: A file paths list. Currently, you can only input one row-based JSON file for each call. | +| `addFile(String file)` | Set a file path to be imported.The paths cannot be empty or null. | `file': A file path. | +| `build()` | Constructs a `BulkInsertParam` object | N/A | + +The `BulkInsertParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. Since only one row-based JSON file is allowed for each call, this result contains one bulk insert task ID. \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/BulkInsert/getBulkInsertState().md b/API_Reference/milvus-sdk-java/v2.3.x/BulkInsert/getBulkInsertState().md new file mode 100644 index 000000000..63cc3875c --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/BulkInsert/getBulkInsertState().md @@ -0,0 +1,71 @@ +# GetBulkInsertStateParam + +A MilvusClient interface. This method gets the state of a bulk-insert task. + +```Java + getBulkInsertState(GetBulkInsertStateParam requestParam); +``` + +## GetBulkInsertStateParam + +Use the `GetBulkInsertStateParam.Builder` to construct a `GetBulkInsertStateParam` object. + +```Java +import io.milvus.param.GetBulkInsertStateParam; +GetBulkInsertStateParam.Builder builder = GetBulkInsertStateParam.newBuilder(); +``` + +Methods of `GetBulkInsertStateParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withTask(Long task)` | Sets the bulk-insert task id returned by `bulkInsert()` to query. | `task`: A task id. | +| `build()` | Constructs a `GetBulkInsertStateParam` object | N/A | + +The `GetBulkInsertStateParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R object`. Since only one row-based JSON file is allowed for each call, this result contains one bulk insert task ID. + +## GetBulkInsertStateWrapper + +A tool class to encapsulate the `GetImportStateResponse`. + +```Java +import io.milvus.response.GetBulkInsertStateWrapper; +GetBulkInsertStateWrapper wrapper = new GetBulkInsertStateWrapper(response); +``` + +Methods of `GetBulkInsertStateWrapper`: + +| Method | Description | Parameters | Returns | +| --- | --- | --- | --- | +| `getTaskID()` | Gets ID of the bulk insert task. | N/A | long | +| `getAutoGeneratedIDs()` | Gets the long ID array for auto-id primary key, generated by bulk insert task. | N/A | List | +| `getState()` | Gets state of the bulk insert task. | N/A | ImportState | +| `getImportedCount()` | Gets how many rows were imported by the bulk insert task. | N/A | long | +| `getCreateTimestamp()` | Gets the integer timestamp when this task is created. | N/A | long | +| `getCreateTimeStr()` | Gets the timestamp in string format when this task is created. | N/A | String | +| `getFailedReason()` | Gets fail reason of the bulk insert task if it failed. | N/A | String | +| `getFiles()` | Gets target files of the bulk insert task. | N/A | String | +| `getCollectionName()` | Gets target collection name of the bulk insert task. | N/A | String | +| `getPartitionName()` | Gets target partition name of the bulk insert task. | N/A | String | +| `getProgress()` | Gets the working progress of a data-import task in percentage | N/A | int | + +## ImportState + +```Java +package io.milvus.grpc; +public enum ImportState +``` + +| State | Code | Description | +| --- | --- | --- | +| Pending | 0 | The task is in the pending list. | +| Failed | 1 | The task failed. Use `getFailedReason()` to get the failure description. | +| Started | 2 | The task is dispatched to the data node and going to be executed. | +| Persisted | 5 | New segments have been generated and persisted. | +| Completed | 6 | If the collection index has been specified, **Completed** indicates new segments have been indexed successfully. Otherwise, the task state will be directly converted from **Persisted** to **Completed**. | +| Failed and cleaned | 7 | The task failed, and the temporary data generated by this task has been cleaned. | \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/BulkInsert/listBulkInsertTasks().md b/API_Reference/milvus-sdk-java/v2.3.x/BulkInsert/listBulkInsertTasks().md new file mode 100644 index 000000000..61ce40522 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/BulkInsert/listBulkInsertTasks().md @@ -0,0 +1,33 @@ +# listBulkInsertTasks() + +A MilvusClient interface. This method lists bulk insert tasks. + +```Java +R listBulkInsertTasks(ListBulkInsertTasksParam requestParam); +``` + +## ListBulkInsertTasksParam + +Use the `ListBulkInsertTasksParam.Builder` to construct a `ListBulkInsertTasksParam` object. + +```Java +import io.milvus.param.ListBulkInsertTasksParam; +ListBulkInsertTasksParam.Builder builder = ListBulkInsertTasksParam.newBuilder(); +``` + +Methods of `ListBulkInsertTasksParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withCollectionName(String collectionName)` | Sets the target collection name, list all tasks if the name is empty. | `collectionName`: The name of the target collection. | +| `withLimit(Integer limit)` | Specifies limit count of returned tasks, list all tasks if the value is 0.
Default value is 0 | `limit`: limit number | +| `build()` | Constructs a `GetBulkInsertStateParam` | object | N/A | + +The `ListBulkInsertTasksParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +The `ListImportTasksResponse` contains a list of `GetImportStateResponse`, which you can use `GetBulkInsertStateWrapper` to parse. Call the `getTasksList()` of `ListImportTasksResponse` to get all the tasks. \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/alterCollection().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/alterCollection().md new file mode 100644 index 000000000..0377a0999 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/alterCollection().md @@ -0,0 +1,54 @@ +# alterCollection() + +A MilvusClient interface. This method changes the specified collection properties. + +```java +R alterCollection(AlterCollectionParam requestParam); +``` + +## AlterCollectionParam + +Use the `AlterCollectionParam.Builder` to construct an AlterCollectionParam object. + +```java +import io.milvus.param.AlterCollectionParam; +AlterCollectionParam.Builder builder = AlterCollectionParam.newBuilder(); +``` + +Methods of `AlterCollectionParam.Builder`: + +| Method | Description | Parameters | +| ------ | ----------- | ---------- | +| `withCollectionName(String collectionName)` | Sets the collection name. This is mandatory and cannot be empty or null. | `collectionName`: Name of the collection whose properties are to be changed. | +| `withTTL(Integer ttlSeconds)` | Sets the time-to-live (TTL) of a collection. A collection expires when TTL ends and all the data in the collection will be cleaned up. An expired collection is never involved in searches and queries. | `ttlSeconds`: TTL in seconds. The value should be 0 or a positive integer. | +| `build()` | Constructs a `AlterCollectionParam` object | N/A | + +The `AlterCollectionParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```java + +import io.milvus.param.*; + +AlterCollectionParam param = AlterCollectionParam.newBuilder() + .withCollectionName(collectionName) + .withTTL(1800) + .build(); +R response = client.alterCollection(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/createCollection().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/createCollection().md new file mode 100644 index 000000000..77378a428 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/createCollection().md @@ -0,0 +1,106 @@ +# createCollection() + +A MilvusClient interface. This method creates a collection with a specified schema. + +```Java +R createCollection(CreateCollectionParam requestParam); +``` + +## CreateCollectionParam + +Use the `CreateCollectionParam.Builder` to construct a `CreateCollectionParam` object. + +```Java +import io.milvus.param.CreateCollectionParam; +CreateCollectionParam.Builder builder = CreateCollectionParam.newBuilder(); +``` + +Methods of `CreateCollectionParam.Builder`: + +| Method | Description | Parameters | +| -------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to create. | +| `withShardsNum(int shardsNum)` | Sets the the number of shards. The shard number must be greater than zero. The default value is 0, letting the Milvus server decide the value. The Milvus server always sets this value to 1 if left unspecified. | `shardsNum`: The number of shards to split the inserted data into. Multiple shards are processed by multiple nodes in Milvus. | +| `withDescription(String description)` | Sets the collection description. The description can be empty. The default description is "". | `description`: The description of the collection to create. | +| `withFieldTypes(List fieldTypes)` | Sets the collection schema. The collection schema cannot be empty. | `fieldTypes`: a list of `FieldType`, each representing a field schema. | +| `addFieldType(FieldType fieldType)` | Adds a field schema. | `fieldType`: The schema of a field to add in the collection. | +| `withConsistencyLevel(ConsistencyLevelEnum consistencyLevel)` | Sets the consistency level. The default value is `ConsistencyLevelEnum.BOUNDED` | `consistencyLevel`: Consistency level of this collection. | +| `withPartitionNum(int partitionNum)` | Sets the number of partitions if there is a partition key field. The number must be greater than zero.
The default value is 64, and the upper limit is 4096.
This setting is not allowed if none of the fields is set as the partition key. You can set only one partition key in a collection.| `partitionNum`: Number of partitions. | +| `build()` | Constructs a `CreateCollectionParam` object. | N/A | + +The `CreateCollectionParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## FieldType + +A tool class to represent a field's schema. Use `FieldType.Builder` to build a `FieldType` object. + +```Java +import io.milvus.param.FieldType; +FieldType.Builder builder = FieldType.newBuilder(); +FieldType ft = builder.build() +``` + +Methods of `FieldType.Builder`: + +| Method | Description | Parameters | +| ---------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withName(String name)` | Sets the name of the field. The name cannot be empty or null. | `Name`: The name of the field. | +| `withPrimaryKey( +primaryKey)` | Sets the field as the primary key field. Only the fields whose data type is `int64` or `varchar` can be set as the primary key field. The value is `false` by default. | `primaryKey`: A boolean value that indicates if the field is the primary key field. The value `true` means that the field is the primary key field while the value `false` means it is not. | +| `withDescription(String description)` | Sets the field description. The description can be empty. The default value is "". | `Description`: The description of the field. | +| `withDataType(DataType dataType)` | Sets the data type for the field. Please refer to [DataType](../Misc/DataType.md) in Misc. | `dataType`: The data type of the field. | +| `addTypeParam(String key, String value)` | Adds a parameter pair for the field. This is mainly used to set extra parameters for the vector field and VARCHAR field. | `key`: The parameter key.`Value`: The parameter value. | +| `withDimension(Integer dimension)` | Sets the dimension of a vector field. The dimension value must be greater than zero. This method internally calls `addTypeParam()` to store the dimension value. | `dimension`: The dimension of the vector field. | +| `withMaxLength(Integer maxLength)` | Sets the maximum length of a varchar field. The value must be greater than zero. This method internally calls the `addTypeParam()` to store the maximum length value. | `maxLength`: The maximum length of the varchar field. | +| `withAutoID(boolean autoID)` | Enables auto-ID function for the field. Note that the auto-ID function can only be enabled on primary key field. If auto-ID function is enabled, Milvus automatically generates a unique ID for each entity so that values for the primary key field do not need to be provided during data insertion. If auto-ID is disabled, values for the primary key field need to be provided during data insertion. | `autoID`: A boolean value that indicates if the primary keys are automatically generated. The value `true` means that auto-ID is enabled, while the value `false` means it is not. | +| `withPartitionKey(boolean partitionKey)` | Sets this field to act as the partition key field.
Milvus hashes the values of the partition key field for the distribution of data among logical partitions.
Only an INT64 or a VARCHAR field except the primary key field can be set as the partition key field. | `partitionKey`: A boolean value that indicates if this field is the partition key field. The value `true` indicates this field is the partition key, while the value `false` indicates the opposite. You can set only one partition key field for each collection. | +| `build()` | Creates a `FieldType` object. | N/A | + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +List fieldsSchema = new ArrayList<>(); +FieldType field_1 = FieldType.newBuilder() + .withPrimaryKey(true) + .withAutoID(false) + .withDataType(DataType.Int64) + .withName("uid") + .withDescription("unique id") + .build(); + +fieldsSchema.add(field_1); + +FieldType field_2 = FieldType.newBuilder() + .withDataType(DataType.FloatVector) + .withName("embedding") + .withDescription("embeddings") + .withDimension(dimension) + .build(); +fieldsSchema.add(field_2); + +// create collection +CreateCollectionParam param = CreateCollectionParam.newBuilder() + .withCollectionName(collectionName) + .withDescription("a collection for search") + .withFieldTypes(fieldsSchema) + .build(); + +R response = client.createCollection(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/delete().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/delete().md new file mode 100644 index 000000000..88ad3f5a6 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/delete().md @@ -0,0 +1,57 @@ +# delete() + +A MilvusClient interface. This method deletes an entity or entities from a collection by filtering the primary key field with [boolean expression](https://milvus.io/docs/v2.1.x/boolean.md). + +```Java +R delete(DeleteParam requestParam); +``` + +## DeleteParam + +Use the `DeleteParam.Builder` to construct a `DeleteParam` object. + +```Java +import io.milvus.param.DeleteParam; +DeleteParam.Builder builder = DeleteParam.newBuilder(); +``` + +Methods of `DeleteParam.Builder`: + +| Method | Description | Parameters | +| ----------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to delete the entity or entities from. | +| `withPartitionName(String partitionName)` | Sets the target partition name (Optional). | `partitionName`: The name of the partition to delete the entity or entities from. | +| `withExpr(String expr)` | Sets the expression filtering to pick out the entities to be deleted. Currently, only expression in the format of "pk_field in [1, 2, ...]" is supported. | `expr`: The expression used for filtering the primary key field. | +| `build()` | Constructs a `DeleteParam` object. | N/A | + +The `DeleteParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `MutationResult` held by the R template. You can use `MutationResultWrapper` to get the returned information. See the corresponding section in [insert()](insert().md#MutationResultWrapper) for more information about `MutationResultWrapper`. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.MutationResult; + +DeleteParam param = DeleteParam.newBuilder() + .withCollectionName(collectionName) + .withPartitionName(partitionName) + .withExpr("id in [100, 200, 300]") + .build(); +R response = milvusClient.delete(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/describeCollection().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/describeCollection().md new file mode 100644 index 000000000..055baccf9 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/describeCollection().md @@ -0,0 +1,81 @@ +# describeCollection() + +A MilvusClient interface. This method shows the details of a collection, including collection name, schema, and more. + +```Java +R describeCollection(DescribeCollectionParam requestParam); +``` + +## DescribeCollectionParam + +Use the `DescribeCollectionParam.Builder` to construct a `DescribeCollectionParam` object. + +```Java +import io.milvus.param.DescribeCollectionParam; +DescribeCollectionParam.Builder builder = DescribeCollectionParam.newBuilder(); +``` + +Methods of `DescribeCollectionParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to show details of. | +| `build()` | Constructs a `DescribeCollectionParam` object. | N/A | + +The `DescribeCollectionParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `DescribeCollectionResponse` held by the R template. You can use `DescCollResponseWrapper` to get the information. + +## DescCollResponseWrapper + +A tool class to encapsulate the `DescribeCollectionResponse`. + +```Java +import io.milvus.response.DescCollResponseWrapper; +DescCollResponseWrapper wrapper = new DescCollResponseWrapper(descCollectionResponse); +``` + +Methods of `DescCollResponseWrapper`: + +| Method | Description | Parameters | Returns | +| ---------------------------------- | ------------------------------------------------------------ | ----------------------- | --------------- | +| `getCollectionName()` | Gets the name of the collection. | N/A | String | +| `getCollectionDescription()` | Gets the description of the collection. | N/A | String | +| `getCollectionID()` | Gets the ID of the collection. | N/A | long | +| `getShardNumber()` | Gets the number of shards of the collection. | N/A | Int | +| `getCreatedUtcTimestamp()` | Gets the UTC timestamp that indicates when the collection is created. | N/A | long | +| `getAliases()` | Gets the alias of the collection. | N/A | List | +| `getFields()` | Gets all field schemas in the collection. | N/A | List<[FieldType](createCollection().md#FieldType)> | +| `getFieldByName(String fieldName)` | Gets a field schema by its field name. | fieldName: a field name | FieldType | +| `isDynamicFieldEnabled()` | Get whether dynamic fields are allowed in the collection. | N/A | boolean | +| `getPartitionKeyField()` | Get the field on which partition key is enabled. | N/A | FieldType | + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.DescCollResponseWrapper; +import io.milvus.grpc.DescribeCollectionResponse; + +DescribeCollectionParam param = DescribeCollectionParam.newBuilder() + .withCollectionName(collectionName) + .build(); +R response = client.describeCollection(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +DescCollResponseWrapper wrapper = new DescCollResponseWrapper(response.getData()); +System.out.println("Collection ID: " + wrapper.getCollectionID()); +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/dropCollection().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/dropCollection().md new file mode 100644 index 000000000..4cf103c8e --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/dropCollection().md @@ -0,0 +1,56 @@ +# dropCollection() + +A MilvusClient interface. This method drops a specified collection. + +
+This method drops all data within the collection. +
+ +```Java +R dropCollection(DropCollectionParam requestParam); +``` + +## DropCollectionParam + +Use the `DropCollectionParam.Builder` to construct a `DropCollectionParam` object. + +```Java +import io.milvus.param.DropCollectionParam; +DropCollectionParam.Builder builder = DropCollectionParam.newBuilder(); +``` + +Methods of `DropCollectionParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------------- | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to drop. | +| `build()` | Constructs a `DropCollectionParam` object. | N/A | + +The `DropCollectionParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +DropCollectionParam dropParam = DropCollectionParam.newBuilder() + .withCollectionName(collectionName) + .build(); + +R response = client.dropCollection(dropParam); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/flush().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/flush().md new file mode 100644 index 000000000..82ddba918 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/flush().md @@ -0,0 +1,60 @@ +# flush() + +A MilvusClient interface. This method triggers a flush action in which all growing segments in the specified collection are marked as sealed and then flushed to storage. + +```Java +R flush(FlushParam requestParam); +``` + +## FlushParam + +Use the `FlushParam.Builder` to construct a `FlushParam` object. + +```Java +import io.milvus.param.FlushParam; +FlushParam.Builder builder = FlushParam.newBuilder(); +``` + +Methods of `FlushParam.Builder`: + +| Method | Description | Parameters | +| --------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionNames(List collectionNames)` | Sets a list of collections to be flushed. | `collectionNames`: A list of the names of the collections to be flushed. | +| `addCollectionName(String collectionName)` | Adds a collection to be flushed. | `collectionName`: The name of the collection to be flushed. | +| `withSyncFlush(Boolean syncFlush)` | Sets the flush function to sync mode. With sync mode enabled, the client keeps waiting until all segments of the collection are successfully flushed. If sync mode is disabled, the client immediately returns the result after `flush()` is called. | `syncFlush`: A boolean value to indicate if sync mode is enabled. Sync mode is enabled if the value is set to `True`. | +| `withSyncFlushWaitingInterval(Long milliseconds)` | Sets the waiting interval in sync mode. With sync mode enabled, the client will check segments status at intervals. The value must be greater than zero, and cannot be greater than `Constant.MAX_WAITING_FLUSHING_INTERVAL`. The default value is `500` miliseconds. | `milliseconds`: The time interval in milliseconds for checking the flush status. | +| `withSyncFlushWaitingTimeout(Long seconds)` | Sets the timeout period for sync mode. The value must be greater than zero, and cannot be greater than `Constant.MAX_WAITING_FLUSHING_TIMEOUT`. The default value is `60` seconds. | `seconds`: A duration of time in seconds to wait till timeout. | +| `build()` | Constructs a `FlushParam` object. | N/A | + +The `FlushParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `FlushResponse` held by the R template. The `FlushResponse` contains a map of collection name and a corresponding list of flushed segments. The map is internally used by other SDK methods such as [createIndex()](../Index/createIndex().md). + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.FlushResponse; + +FlushParam param = FlushParam.newBuilder() + .addCollectionName(collectionName) + .build(); +R response = client.flush(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +GetCollStatResponseWrapper wrapper = new GetCollStatResponseWrapper(response.getData()); +System.out.println("Row count: " + wrapper.getRowCount()); +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/getCollectionStatistics().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getCollectionStatistics().md new file mode 100644 index 000000000..dedae8169 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getCollectionStatistics().md @@ -0,0 +1,79 @@ +# getCollectionStatistics() + +A MilvusClient interface. This method shows the statistical information of a specified collection. + + +
+The current version only returns the row count of a collection. This method can be deprecated in the future. +
+ + +```Java +R getCollectionStatistics(GetCollectionStatisticsParam requestParam); +``` + +## GetCollectionStatisticsParam + +Use the `GetCollectionStatisticsParam.Builder` to construct a `GetCollectionStatisticsParam` object. + +```Java +import io.milvus.param.GetCollectionStatisticsParam; +GetCollectionStatisticsParam.Builder builder = GetCollectionStatisticsParam.newBuilder(); +``` + +Methods of `GetCollectionStatisticsParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection whose statistical information needs to be checked. | +| `withFlush(Boolean flush)` | Requests a flush action before retrieving collection statistics. | `flush`: Set the value to `true` to perform a flush action. | +| `build()` | Constructs a `GetCollectionStatisticsParam` object. | N/A | + +The `GetCollectionStatisticsParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetCollectionStatisticsResponse` held by the R template. You can use `GetCollStatResponseWrapper` to get the information. + +## GetCollStatResponseWrapper + +A tool class to encapsulate the `GetCollectionStatisticsResponse`. + +```Java +import io.milvus.response.GetCollStatResponseWrapper; +GetCollStatResponseWrapper wrapper = new GetCollStatResponseWrapper(getStatResponse); +``` + +Methods of `GetCollStatResponseWrapper`: + +| Method | Description | Parameters | Returns | +| --------------- | ------------------------------------------------------------ | -------------- | ----------- | +| `getRowCount()` | Gets the row count of a collection. Note that due to technical reasones, the deleted entities are not counted in the row count. | N/A | long | + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.GetCollStatResponseWrapper; +import io.milvus.grpc.GetCollectionStatisticsResponse; + +GetCollectionStatisticsParam param = GetCollectionStatisticsParam.newBuilder() + .withCollectionName(collectionName) + .build(); +R response = client.getCollectionStatistics(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +GetCollStatResponseWrapper wrapper = new GetCollStatResponseWrapper(response.getData()); +System.out.println("Row count: " + wrapper.getRowCount()); +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/getLoadState().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getLoadState().md new file mode 100644 index 000000000..a83ea3669 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getLoadState().md @@ -0,0 +1,50 @@ +# getLoadState() + +A Milvus interface. This method gets the state of the collection-loading progress. + +```Java +R getLoadState(GetLoadStateParam requestParam); +``` + +## GetLoadStateParam + +Use the `GetLoadStateParam.Builder` to construct a `GetLoadStateParam` object. + +```java +import io.milvus.param.GetLoadStateParam; +GetLoadStateParam.Builder builder = GetLoadStateParam.newBuilder(); +``` + +Methods of `GetLoadStateParam.Builder`: + +| Method | Description | Parameters | +| ------ | ----------- | ---------- | +| `withCollectionName(String collectionName)` | Sets a collection name. Collection name cannot be empty or Null. | `collectionName`: Name of the collection to load. | +| `withPartitionName(List partitionNames)` | (Optional) Sets a list of partition names to narrow the search scope. | `partitionNames`: List of partition names | +| `addPartitionName(String partitionName)` | Adds a partition by its name. Partition name cannot be empty or Null. | `partitionName`: Name of the partition to be added. | +| `build()` | Constructs a `GetLoadStateParam` object. | N/A | + +The `GetLoadStateParam.Builder.build()` can throw the follwoing exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status`.Unknow and the error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```java +import io.milvus.param.*; + +GetLoadStateParam param = GetLoadStateParam.newBuilder() + .withCollectionName(collectionName) + .build(); +R response = client.getLoadState(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +System.out.println(response.getState()); +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/getLoadingProgress().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getLoadingProgress().md new file mode 100644 index 000000000..7fc9f7b30 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getLoadingProgress().md @@ -0,0 +1,48 @@ +# getLoadingProgress() + +A MilvusClient interface. This method gets loading collection progress. + +```Java +R getLoadingProgress(GetLoadingProgressParam requestParam); +``` + +## LoadCollectionParam + +Use the `GetLoadingProgressParam.Builder` to construct a `GetLoadingProgressParam` object. + +```Java +import io.milvus.param.GetLoadingProgressParam; +GetLoadingProgressParam.Builder builder = GetLoadingProgressParam.newBuilder(); +``` + +Methods of `GetLoadingProgressParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withCollectionName(String collectionName)` | Sets the collection name. Collection name cannot be empty or null. | `collectionName`: The name of the collection to load. | +| `withPartitionNames(List partitionNames)` | Sets partition names list to specify query scope (Optional). | `partitionNames`: Partition names list. | + +The `GetLoadingProgressParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns R.Status.Unknow and the error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +GetLoadingProgressParam param = GetLoadingProgressParam.newBuilder() + .withCollectionName(collectionName) + .build(); +R response = client.getLoadingProgress(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +System.out.println(response.getProgress()); +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/getPersistentSegmentInfo().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getPersistentSegmentInfo().md new file mode 100644 index 000000000..bf5329d3c --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getPersistentSegmentInfo().md @@ -0,0 +1,78 @@ +# getPersistentSegmentInfo() + +A MilvusClient interface. This method gets the information of persisted segments from data node, including row count, persistence state (growing or flushed), and more. + +```Java +R getPersistentSegmentInfo(GetPersistentSegmentInfoParam requestParam); +``` + +## GetPersistentSegmentInfoParam + +Use the `GetPersistentSegmentInfoParam.Builder` to construct a `GetPersistentSegmentInfoParam` object. + +```Java +import io.milvus.param.GetPersistentSegmentInfoParam; +GetPersistentSegmentInfoParam.Builder builder = GetPersistentSegmentInfoParam.newBuilder(); +``` + +Methods of `GetPersistentSegmentInfoParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | --------------------------------------------- | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection. | +| `build()` | Constructs a `GetPersistentSegmentInfoParam` object. | N/A | + +The `GetPersistentSegmentInfoParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetPersistentSegmentInfoResponse` held by the R template. The `GetPersistentSegmentInfoResponse` object contains a list of `PersistentSegmentInfo`, and you can use `getState()` in `PersistentSegmentInfo` to get the state of the segment. + +## SegmentState + +```Java +package io.milvus.grpc; +public enum SegmentState +``` + +| Type | Code | Description | +| ---------------- | -------- | ------------------------------------------------ | +| SegmentStateNone | 0 | For internal usage. | +| NotExist | 1 | For internal usage. | +| Growing | 2 | A growing segment in query node. | +| Sealed | 3 | The segment is sealed and waiting to be flushed. | +| Flushed | 4 | The segment has been flushed to storage. | +| Flushing | 5 | The server is flushing this segment. | +| Dropped | 6 | The segment has been marked as deleted. | +| Importing | 7 | Reserved for bulkload interface. | + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetPersistentSegmentInfoResponse; +import io.milvus.grpc.PersistentSegmentInfo; + +GetPersistentSegmentInfoParam param = GetPersistentSegmentInfoParam.newBuilder() + .withCollectionName(collectionName) + .build(); +R response = client.getPersistentSegmentInfo(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +GetPersistentSegmentInfoResponse segmentInfo = response.getData(); +for (int i = 0; i < segmentInfo.getInfosCount(); i++) { + PersistentSegmentInfo info = segmentInfo.getInfos(i); + System.out.println("Segment ID: " + info.getSegmentID() + ", state: " + info.getState() + ", rows: " + info.getNumRows()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/getQuerySegmentInfo().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getQuerySegmentInfo().md new file mode 100644 index 000000000..d96adeaf1 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getQuerySegmentInfo().md @@ -0,0 +1,60 @@ +# getQuerySegmentInfo() + +A MilvusClient interface. This method gets the query information of segments in a collection from query node, including row count, memory usage, index name, and more. + +```Java +R getQuerySegmentInfo(GetQuerySegmentInfoParam requestParam); +``` + +## GetQuerySegmentInfoParam + +Use the `GetQuerySegmentInfoParam.Builder` to construct a `GetQuerySegmentInfoParam` object. + +```Java +import io.milvus.param.GetQuerySegmentInfoParam; +GetQuerySegmentInfoParam.Builder builder = GetQuerySegmentInfoParam.newBuilder(); +``` + +Methods of `GetQuerySegmentInfoParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to get the query information of the segment from. | +| `build()` | Constructs a `GetQuerySegmentInfoParam` object. | N/A | + +The `GetQuerySegmentInfoParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetQuerySegmentInfoResponse` held by the R template. The `GetQuerySegmentInfoResponse` object contains a list of `QuerySegmentInfo`, and you can use `getState()` in `QuerySegmentInfo` to get the state of the segment. This process is similar to that of [PersistentSegmentInfo](getPersistentSegmentInfo().md). + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetQuerySegmentInfoResponse; +import io.milvus.grpc.QuerySegmentInfo; + +GetQuerySegmentInfoParam param = GetQuerySegmentInfoParam.newBuilder() + .withCollectionName(collectionName) + .build(); +R response = client.getQuerySegmentInfo(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +GetQuerySegmentInfoResponse segmentInfo = response.getData(); +for (int i = 0; i < segmentInfo.getInfosCount(); i++) { + QuerySegmentInfo info = segmentInfo.getInfos(i); + System.out.println("Segment ID: " + info.getSegmentID() + ", state: " + info.getState() + ", rows: " + info.getNumRows()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/getReplicas().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getReplicas().md new file mode 100644 index 000000000..e91e673b9 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/getReplicas().md @@ -0,0 +1,60 @@ +# getReplicas() + +A MilvusClient interface. This method lists the replica information of a specified collection. + +```Java +R getReplicas(GetReplicasParam requestParam); +``` + +## GetReplicasParam + +Use the `GetReplicasParam.Builder` to construct a `GetReplicasParam` object. + +```Java +import io.milvus.param.GetReplicasParam; +GetReplicasParam.Builder builder = GetReplicasParam.newBuilder(); +``` + +Methods of `GetReplicasParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection whose replica information needs to be listed. | +| `build()` | Constructs a `GetReplicasParam` object. | N/A | + +The `GetReplicasParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetReplicasResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetReplicasResponse; +import io.milvus.grpc.ReplicaInfo; + +GetReplicasParam param = GetReplicasParam.newBuilder() + .withCollectionName(collectionName) + .build(); +R response = client.getReplicas(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +GetReplicasResponse replicas = response.getData(); +for (int i = 0; i < replicas.getReplicasCount(); i++) { + ReplicaInfo info = replicas.getReplicas(i); + System.out.println("Replica ID: " + info.getReplicaID() + ", nodes: " + info.getNodeIdsList().toString()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/insert().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/insert().md new file mode 100644 index 000000000..a65ce4e4e --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/insert().md @@ -0,0 +1,97 @@ +# insert() + +A MilvusClient interface. This method inserts entities into a specified collection. + +```Java +R insert(InsertParam requestParam); +``` + +## InsertParam + +Use the `InsertParam.Builder` to construct an `InsertParam` object. + +```Java +import io.milvus.param.InsertParam; +InsertParam.Builder builder = InsertParam.newBuilder(); +``` + +Methods of `InsertParam.Builder`: + +| Method | Description | Parameters | +| -------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(String collectionName)` | Sets the target collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to insert data into. | +| `withPartitionName(String partitionName)` | Sets the target partition name (optional). | `partitionName`: The name of the partition to insert data into. | +| `withFields(List fields)` | Sets the data to be inserted. The field list cannot be empty. Note that no input is required for the primary key field if auto-ID is enabled. | `fields`: a list of `Field` objects, each representing a field. | +| `build()` | Constructs an `InsertParam` object. | N/A | + +The `InsertParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Field + +A tool class to hold a data field. + +Methods of `InsertParam.Field`: + +| Method | Description | Parameters | +| ------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `Field(String name, List values)` | This class only provides a `Constructor`to create a `Field` object. | `name`: The name of the data field.
`values`:
  • If data type is Bool, `values` is List of Boolean;
  • If data type is Int64, `values` is List of Long;
  • If data type is Float, `values` is List of Float;
  • If data type is Double, `values` is List of Double;
  • If data type is VARCHAR, `values` is List of String;
  • If data type is FloatVector, `values` is List of List Float;
  • If data type is BinaryVector, `values` is List of ByteBuffer.
| + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `MutationResult` held by the R template. You can use `MutationResultWrapper` to get the returned information. + +## MutationResultWrapper + +A tool class to encapsulate the `MutationResult`. + +```Java +import io.milvus.response.MutationResultWrapper; +MutationResultWrapper wrapper = new MutationResultWrapper(mutationResult); +``` + +Methods of `MutationResultWrapper`: + +| Method | Description | Returns | +| ------------------ | ------------------------------------------------------------ | ------------ | +| `getInsertCount()` | Gets the row count of the inserted entities. | long | +| `getLongIDs()` | Gets the long ID array returned by the `insert()` interface if the primary key field is int64 type. Throws `ParamException` if the primary key type is not int64. | List | +| `getStringIDs()` | Gets the string ID array returned by the `insert()` interface if the primary key field is VARCHAR type. Throws `ParamException` if the primary key type is not VARCHAR type. | List | +| `getDeleteCount()` | Gets the row count of the deleted entities. Currently, this value is always equal to the input row count. | long | +| `getOperationTs()` | Gets the timestamp of the operation marked by the server. You can use this timestamp as the guarantee timestamp of query/search APIs. Note that the timestamp is not an absolute timestamp, but rather a hybrid value combined by UTC time and internal flags. | long | + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.MutationResult; + +List fields = new ArrayList<>(); +int rowCount = 10000; +List ids = new ArrayList<>(); +for (long i = 0L; i < rowCount; ++i) { + ids.add(i); +} +List> vectors = generateFloatVectors(rowCount); + +List fieldsInsert = new ArrayList<>(); +fieldsInsert.add(new InsertParam.Field("id", ids)); +fieldsInsert.add(new InsertParam.Field("vec", vectors)); + +InsertParam param = InsertParam.newBuilder() + .withCollectionName(collectionName) + .withFields(fieldsInsert) + .build(); +R response = client.insert(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/insertAsync().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/insertAsync().md new file mode 100644 index 000000000..cb6f5491d --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/insertAsync().md @@ -0,0 +1,30 @@ +# insertAsync() + +A MilvusClient interface. This method inserts entities asynchronously into a specified collection. + +```Java +ListenableFuture> insertAsync(InsertParam requestParam); +``` + +This method uses the same parameter as [insert()](insert().md#InsertParam), invokes the RPC interface and returns a `ListenableFuture` object immediately. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.QueryResults; +import com.google.common.util.concurrent.ListenableFuture; + +QueryParam param = QueryParam.newBuilder() + .withCollectionName("collection1") + .withExpr("id in [100, 101]") + .addOutFields("field1") + .withConsistencyLevel(ConsistencyLevelEnum.EVENTUALLY) + .build(); +ListenableFuture> futureResults = client.queryAsync(param); +R response = futureResults.get(); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/loadCollection().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/loadCollection().md new file mode 100644 index 000000000..e3db3da8f --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/loadCollection().md @@ -0,0 +1,61 @@ +# loadCollection() + +A MilvusClient interface. This method loads the specified collection and all the data within to memory for search or query. + +```Java +R loadCollection(LoadCollectionParam requestParam); +``` + +## LoadCollectionParam + +Use the `LoadCollectionParam.Builder` to construct a `LoadCollectionParam` object. + +```Java +import io.milvus.param.LoadCollectionParam; +LoadCollectionParam.Builder builder = LoadCollectionParam.newBuilder(); +``` + +Methods of `LoadCollectionParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to load. | +| `withSyncLoad(Boolean syncLoad)` | Enables sync mode when loading a collection. With sync mode enabled, the client keeps waiting until all segments of the collection are successfully loaded. If sync mode is disabled, the client returns instantly after `loadCollection()` is called. Sync mode is enabled by default. | `syncLoad`:A boolean value to indicate if sync mode is enabled. If the value is set to `True`, this means sync mode is enabled. | +| `withSyncLoadWaitingInterval(Long milliseconds)` | Sets the waiting interval for sync mode. In sync mode, the client checks the collection load status at intervals. The value must be greater than zero, and cannot be greater than `Constant.MAX_WAITING_LOADING_INTERVAL`. The default value is `500` milliseconds. | `milliseconds`: The time interval in milliseconds for checking the data load status. | +| `withSyncLoadWaitingTimeout(Long seconds)` | Sets the timeout period for sync mode. The value must be greater than zero and cannot be greater than `Constant.MAX_WAITING_LOADING_TIMEOUT`. The default value is `60` seconds. | `seconds`: A duration of time in seconds to wait till timeout. | +| `withReplicaNumber(Integer replicaNumber)` | Specifies the number of replicas to load. The default value is `1`. | `replicaNumber`: The number of the replicas to load when loading a collection. | +| `withRefresh(Boolean refresh)` | Specifies whether to renew the segement list of this collection before loading. The flag must be `FALSE` when you load a collection for the first time. Set the flag to `TRUE` have Milvus look for the segments that are not loaded and try to load them into query nodes. | `refresh`: The flag to indicate whether to have Milvus renew the segment list. +| `build()` | Constructs a `LoadCollectionParam` object. | N/A | + +The `LoadCollectionParam.Builder.build()` could throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +LoadCollectionParam param = LoadCollectionParam.newBuilder() + .withCollectionName(collectionName) + .withReplicaNumber(2) + .withSyncLoad(Boolean.TRUE) + .withSyncLoadWaitingInterval(500L) + .withSyncLoadWaitingTimeout(30L) + .build(); +R response = client.loadCollection(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/releaseCollection().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/releaseCollection().md new file mode 100644 index 000000000..9755c7be9 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/releaseCollection().md @@ -0,0 +1,52 @@ +# releaseCollection() + +A MilvusClient interface. This method releases the specified collection and all data within it from memory. + +```Java +R releaseCollection(ReleaseCollectionParam requestParam); +``` + +## ReleaseCollectionParam + +Use the `ReleaseCollectionParam.Builder` to construct a `ReleaseCollectionParam` object. + +```Java +import io.milvus.param.ReleaseCollectionParam; +ReleaseCollectionParam.Builder builder = ReleaseCollectionParam.newBuilder(); +``` + +Methods of `ReleaseCollectionParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | -------------------------------------------------------- | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to release. | +| `build()` | Constructs a `ReleaseCollectionParam` object. | N/A | + +The `ReleaseCollectionParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +ReleaseCollectionParam param = ReleaseCollectionParam.newBuilder() + .withCollectionName(collectionName) + .build(); +R response = client.releaseCollection(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Collection/showCollections().md b/API_Reference/milvus-sdk-java/v2.3.x/Collection/showCollections().md new file mode 100644 index 000000000..33bd39e07 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Collection/showCollections().md @@ -0,0 +1,87 @@ +# showCollections() + +A MilvusClient interface. This method lists all the collections or gets the collection loading status. + +```Java +R showCollections(ShowCollectionsParam requestParam); +``` + +## ShowCollectionsParam + +Use the `ShowCollectionsParam.Builder` to construct a `ShowCollectionsParam` object. + +```Java +import io.milvus.param.ShowCollectionsParam; +ShowCollectionsParam.Builder builder = ShowCollectionsParam.newBuilder(); +``` + +Methods of `ShowCollectionsParam.Builder`: + +| Method | Description | Parameters | +| --------------------------------------------------- | ------------------------------------------------------------ | ---------------------------------------------------------- | +| `withCollectionNames(List collectionNames)` | Sets a list of collection names. If the list is empty, the method will return all the collections in database. The collection name cannot be empty or null. | `collectionNames`: A list of the collection names to show. | +| `addCollectionName(String collectionName)` | Adds a collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to show. | +| `build()` | Constructs a `ShowCollectionsParam` object. | N/A | + +The `ShowCollectionsParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `ShowCollectionsResponse` held by the R template. You can use `ShowCollResponseWrapper` to get the information. + +## ShowCollResponseWrapper + +A tool class to encapsulate the `ShowCollectionsResponse`. + +```Java +import io.milvus.response.ShowCollResponseWrapper; +ShowCollResponseWrapper wrapper = new ShowCollResponseWrapper(showCollectionsResponse); +``` + +Methods of `ShowCollResponseWrapper`: + +| Method | Description | Parameters | Returns | +| ------------------------------------------------ | ------------------------------------------------------------ | --------------------------------- | -------------------- | +| `getCollectionsInfo()` | Returns a list of `CollectionInfo` objects. Each `CollectionInfo` represents a collection. | N/A | List | +| `getCollectionInfoByName(String collectionName)` | Gets a `CollectionInfo` object by collection name. | `collectionName`: Collection name. | CollectionInfo | + +## CollectionInfo + +A tool class to store a collection's information. + +Methods of `ShowCollResponseWrapper.CollectionInfo`: + +| Method | Description | Returns | +| ------------------------- | ------------------------------------------------------------ | ----------- | +| `getName()` | Gets the name of the collection. | String | +| `getId()` | Gets the ID of the collection. | long | +| `getUtcTimestamp()` | Gets a UTC timestamp that indicates when this collection is created. This method is for internal usage. | long | +| `getInMemoryPercentage()` | Load percentage on query node. | long | + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.GetCollStatResponseWrapper; +import io.milvus.grpc.GetCollectionStatisticsResponse; + +GetCollectionStatisticsParam param = GetCollectionStatisticsParam.newBuilder() + .withCollectionName(collectionName) + .build(); +R response = client.getCollectionStatistics(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +GetCollStatResponseWrapper wrapper = new GetCollStatResponseWrapper(response.getData()); +System.out.println("Row count: " + wrapper.getRowCount()); +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Connections/MilvusClient.md b/API_Reference/milvus-sdk-java/v2.3.x/Connections/MilvusClient.md new file mode 100644 index 000000000..4e2435221 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Connections/MilvusClient.md @@ -0,0 +1,85 @@ +# MilvusClient + +MilvusClient is an abstract interface of the Milvus client. `MilvusServiceClient` class is the implementation. + +```Java +package io.milvus.client; +MilvusServiceClient(ConnectParam connectParam) +``` + +Methods of `MilvusClient` for connection: + +| Method | Description | Parameters | Returns | +| ------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | -------------- | +| `withTimeout(long timeout, TimeUnit timeoutUnit)` | The timeout setting for RPC call. |
  • timeout: The timeout period for invoking a method.
  • timeoutUnit: The unit for timeout.
  • | `MilvusClient` | +| `close(long maxWaitSeconds)` | Disconnects from a Milvus server with configurable timeout value. Call this method before the application terminates. This method throws an `InterruptedException` exception if it is interrupted. | `maxWaitSeconds`: The timeout period to wait until the RPC channel closes. | N/A | +| `setLogLevel(LogLevel level)` | Sets the log level at runtime. | `level`: The log level at runtime. | N/A | + +## ConnectParam + +Use the `ConnectParam.Builder` to construct a `ConnectParam` object for the `MilvusServiceClient`. + +```Java +import io.milvus.param.ConnectParam; +ConnectParam.Builder builder = ConnectParam.newBuilder(); +``` + +Methods of `ConnectParam.Builder`: + +| Method | Description | Patameters | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withHost(String host)` | Sets the host name or address. | `host`: The name or address of the host. | +| `withPort(int port)` | Sets the connection port. The value must be greater than zero and less than 65536. | `port`: The connection port. | +| `withConnectTimeout(long connectTimeout, TimeUnit timeUnit)` | Sets the connection timeout value of client channel. The timeout value must be greater than zero. | `connectTimeout`: The connection timeout period. timeUnit: The unit of timeout. | +| `withKeepAliveTime(long keepAliveTime, TimeUnit timeUnit)` | Sets the keep-alive timeout value of the client channel. The timeout value must be greater than zero. |
  • keepAliveTime: The keep-alive timeout period.
  • timeUnit: The unit of timeout.
  • | +| `keepAliveWithoutCalls(boolean enable)` | Enables the keep-alive function for the client channel. | `enable`: A boolean value to indicate if the keep-alive function is enabled. The keep-alive function is enabled if the value is set to `true`. | +| `secure(boolean enable) withSecure(boolean enable)` | Enables security for the client channel. | `enable`: Security is enabled if the value is set to `true`. | +| `withIdleTimeout(long idleTimeout, TimeUnit timeUnit)` | Sets the value of idle timeout of the client channel. The timeout value must be greater than zero. | `idleTimeout`: The idle timeout period of the client channel. `timeUnit`: The unit of timeout. | +| `withAuthorization(String username, String password)` | Sets the username and password for this connection. |
  • username: The username of the current user.
  • password: The password corresponding to the username.
  • | +| `build()` | Constructs a `ConnectParam` object. | N/A | + +The `ConnectParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Example + +- Without timeout setting for RPC call: + +```Java +import io.milvus.param.*; +import io.milvus.client.*; + +ConnectParam connectParam = ConnectParam.newBuilder() + .withHost("localhost") + .withPort(19530) + .withAuthorization("root", "Milvus") + .build(); +MilvusClient client = new MilvusServiceClient(connectParam); + +ShowCollectionsParam param = ShowCollectionsParam.newBuilder().build() +R response = client.showCollections(param); + +client.close(1); +``` + +- With timeout setting for RPC call: + +```Java +import io.milvus.param.*; +import io.milvus.client.*; +import java.util.concurrent.TimeUnit; + +ConnectParam connectParam = ConnectParam.newBuilder() + .withHost("localhost") + .withPort(19530) + .withAuthorization("root", "Milvus") + .build(); +MilvusClient client = new MilvusServiceClient(connectParam); + +ShowCollectionsParam param = ShowCollectionsParam.newBuilder().build(); +R response = client.withTimeout(2, TimeUnit.SECONDS).showCollections(param); + +client.close(1); +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Database/createDatabase().md b/API_Reference/milvus-sdk-java/v2.3.x/Database/createDatabase().md new file mode 100644 index 000000000..f31a8b634 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Database/createDatabase().md @@ -0,0 +1,49 @@ +# createDatabase() + +A MilvusClient interface. This method creates a database. + +```Java +R createDatabase(CreateDatabaseParam requestParam); +``` + +## CreateDatabaseParam + +Use the `CreateDatabaseParam.Builder` to construct a `CreateDatabaseParam` object. + +```Java +import io.milvus.param.CreateDatabaseParam; +CreateDatabaseParam.Builder builder = CreateDatabaseParam.newBuilder() +``` + +Methods of `CreateDatabaseParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withDatabaseName(String databaseName)` | Sets the database name.
    The value cannot be empty or null. | `databaseName`: name of the database. | +| `build()` | Constructs a `CreateDatabaseParam` object | N/A | + +The `CreateDatabaseParam.Builder.build()` throws the following exceptions: + +- `ParamException` is raised if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +CreateDatabaseParam param = CreateDatabaseParam.newBuilder() + .withDatabaseName("mydb") + .build(); +R response = client.createDatabase(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Database/dropDatabase().md b/API_Reference/milvus-sdk-java/v2.3.x/Database/dropDatabase().md new file mode 100644 index 000000000..9d250e004 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Database/dropDatabase().md @@ -0,0 +1,47 @@ +# dropDatabase() + +A MilvusClient interface. This method drops a database. Note that this method drops all data in the database. + +```Java +R dropDatabase(DropDatabaseParam requestParam); +``` + +## DropDatabaseParam + +Use the `DropDatabaseParam.Builder` to construct a `DropDatabaseParam` object. + +```Java +import io.milvus.param.DropDatabaseParam; +DropDatabaseParam.Builder builder = DropDatabaseParam.newBuilder() +``` + +| Method | Description | Parameters | +| ---- | --- | --- | +| `withDatabaseName(String databaseName)` | Sets the name of the database.
    The value cannot be empty or null. | `databaseName`: Name of the database. | +| `build()` | Construct a `DropDatabaseParam` object. | N/A | + +The `DropDatabaseParam.Builder.build()` throws the following exceptions: + +- `ParamException` is raised if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +DropDatabaseParam param = DropDatabaseParam.newBuilder() + .withDatabaseName("mydb") + .build(); +R response = client.dropDatabase(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Database/listDatabases().md b/API_Reference/milvus-sdk-java/v2.3.x/Database/listDatabases().md new file mode 100644 index 000000000..11354c89b --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Database/listDatabases().md @@ -0,0 +1,26 @@ +# listDatabases() + +A MilvusClient interface. This method lists all databases in the cluster. + +```Java +R listDatabases(); +``` + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status.Unknow` and error message of the exception. +- If the API succeeds, it returns a valid `DescribeIndexResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; + +R response = client.listDatabases() +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/High-level API/createCollection().md b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/createCollection().md new file mode 100644 index 000000000..154da6644 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/createCollection().md @@ -0,0 +1,64 @@ +# createCollection() + +A MilvusClient interface. This method creates a collection with a smaller set of parameters. + +```Java +R createCollection(CreateSimpleCollectionParam requestParam); +``` + +## CreateCollectionParam + +Use the `CreateSimpleCollectionParam.Builder` to construct a `CreateSimpleCollectionParam` object. + +```Java +import io.milvus.param.highlevel.collection.CreateCollectionParam; +CreateSimpleCollectionParam.Builder builder = CreateSimpleCollectionParam.newBuilder(); +``` + +Methods of `CreateSimpleCollectionParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withCollectionName(String collectionName)` | Sets the collection name.
    The value cannot be empty or null. | `collectionName`: Name of the collection to create. | +| `withDimension(int dimension)` | Sets the collection vector dimension.
    The value must be greater than zero and less than 32768. | `dimension`: Number of dimensions for the vector field of the collection. | +| `withMetricType(MetricType metricType)` | Sets the metric type of vector field.
    A metric type defines how Milvus measures the distance between vectors. | `metricType`: Algorithm used to measure the distance between vectors. | +| `withDescription(String description)` | Sets the collection description.
    The value can be an empty string. The default description is `""`. | `description`: Description of the collection. | +| `withPrimaryField(String primaryField)` | Sets the name of the primary field.
    The value cannot be empty or null. | `primaryField`: Customized name of the primary field. | +| `withVectorField(String vectorField)` | Sets the name of the vector field.
    The value cannot be empty or null. | `vectorField`: Customized name of the vector field. | +| `withAutoID(boolean autoId)` | Sets whether the primary field automatically increments.
    The value defaults to `false`. | `autoId`: Whether the primary field automatically increments is allowed. | +| `withSyncLoad(boolean syncLoad)` | Sets whether the collection is to be loaded upon creation.
    The value defaults to `true`, indicating that the collection is to be loaded upon creation. | `syncLoad`: Whether the collection is to be loaded upon creation. | +| `withConsistencyLevel(ConsistencyLevelEnum consistencyLevel)` | Sets the consistency level.
    The default value is `ConsistencyLevelEnum.BOUNDED`. | `consistencyLevel`: The consistency level of the collection. | +| `withPrimaryFieldType(DataType primaryFieldType)` | Sets the data type of the primary field.
    The value cannot be empty or null. The default value is `DataType.Int64`. | `primaryFieldType`: The data type of the primary field. | +| `withMaxLength(Integer maxLength)` | Sets the maximum length of the primary field if the data type of the primary field `DataType.VarChar`.
    The value cannot be empty or null. | `maxLength`: The maximum length of the primary field if its data type is `DataType.VarChar`. | +| `build()` | Constructs a `CreateSimpleCollectionParam` object. | N/A | + +The `CreateSimpleCollectionParam.Builder.build()` method can throw the following exceptions: + +- `ParamException` is raised if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.highlevel.collection.*; + +CreateSimpleCollectionParam param = CreateSimpleCollectionParam.newBuilder() + .withCollectionName(COLLECTION_NAME) + .withDimension(VECTOR_DIM) + .withPrimaryField(ID_FIELD) + .withVectorField(VECTOR_FIELD) + .withAutoId(true) + .build(); + +R response = client.createCollection(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/High-level API/delete().md b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/delete().md new file mode 100644 index 000000000..960ec7ad0 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/delete().md @@ -0,0 +1,60 @@ +# delete() + +A MilvusClient interface. This method deletes entity(s) based on their primary keys. + +```Java +R delete(DeleteIdsParam requestParam); +``` + +## DeleteIdsParam + +Use the `DeleteIdsParam.Builder` to construct a `DeleteIdsParam` object. + +```Java +import io.milvus.param.highlevel.dml.DeleteIdsParam; +DeleteIdsParam.Builder builder = DeleteIdsParam.newBuilder(); +``` + +Methods of `DeleteIdsParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withCollectionName(String collectionName)` | Sets the target collection name.
    The value cannot be empty or null. | `collectionName`: Name of the collection from which the entities specified by their primary keys are to be deleted. | +| `withPrimaryIds(List primaryIds)` | Sets the IDs of the entities to be deleted.
    The value cannot be empty or null. | `primaryIds`: A list of primary keys of the entities to be deleted. | +| `addPrimaryId(T primaryId)` | Sets the ID of the entity you want to delete.
    The value cannot be empty or null.
    Use only the values of the primary key. | `primaryId`: ID of the entity you want to delete. | +| `build()` | Constructs a `DeleteIdsParam` object. | N/A | + +The `DeleteIdsParam.Builder.build()` method can throw the following exceptions: + +- `ParamException` is raised if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. +- If the API succeeds, it returns a valid `DeleteResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.highlevel.*; +import io.milvus.response.MutationResultWrapper; +import io.milvus.grpc.MutationResult; + +List ids = Lists.newArrayList("441966745769900131", "441966745769900133"); +DeleteIdsParam param = DeleteIdsParam.newBuilder() + .withCollectionName(COLLECTION_NAME) + .withPrimaryIds(ids) + .build(); + +R response = client.delete(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +for (Object deleteId : response.getData().getDeleteIds()) { + System.out.println(deleteId); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/High-level API/get().md b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/get().md new file mode 100644 index 000000000..b50921f3e --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/get().md @@ -0,0 +1,64 @@ +# get() + +A MilvusClient interface. This method gets entity(s) by their primary fields. Note that the order of the returned entities can not be guaranteed. + +```Java +R get(GetIdsParam requestParam); +``` + +## GetIdsParam + +Use the `GetIdsParam.Builder` to construct a `GetIdsParam` object. + +```Java +import io.milvus.param.highlevel.dml.GetIdsParam; +GetIdsParam.Builder builder = GetIdsParam.newBuilder(); +``` + +Methods of `GetIdsParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withCollectionName(String collectionName)` | Sets the target collection name.
    The value cannot be empty or null. | `collectionName`: Name of the collection from which entities are to be retrieved. | +| `withPrimaryIds(List primaryIds)` | Sets the IDs of the entities to retrieve.
    The value cannot be empty or null. | `primaryIds`: A list of primary keys of the entities to retrieve. | +| `addPrimaryId(T primaryId)` | Sets the ID of the entity you want to retrieve.
    The value cannot be empty or null.
    Use only the values of the primary key. | `primaryId`: ID of the entity you want to retrieve. | +| `withOutputFields(List outputFields)` | (Optional) Sets the output fields. | `outputFields`: A list of output fields you prefer. | +| `withConsistencyLevel(ConsistencyLevelEnum consistencyLevel)` | Sets the consistency level of the collection to get. If not specified, the default consistency level will be used. For details, refer to `ConsistencyLevelEnum` in **Misc**. | `consistencyLevel`: The consistency level of the collection to get. | +| `build()` | Constructs a `GetIdsParam` object. | N/A | + +The `GetIdsParam.Builder.build()` method can throw the following exceptions: + +- `ParamException` is raised if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. +- If the API succeeds, it returns a valid `GetResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.QueryResultsWrapper; +import io.milvus.response.FieldDataWrapper; +import io.milvus.grpc.QueryResults; + +List ids = Lists.newArrayList("441966745769900131", "441966745769900133"); +GetIdsParam getParam = GetIdsParam.newBuilder() + .withCollectionName(COLLECTION_NAME) + .withId(ids) + .withOutputFields(Lists.newArrayList("*")) + .build(); + +R response = client.get(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +for (QueryResultsWrapper.RowRecord rowRecord : response.getData().getRowRecords()) { + System.out.println(rowRecord); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/High-level API/insert().md b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/insert().md new file mode 100644 index 000000000..b6638fe11 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/insert().md @@ -0,0 +1,84 @@ +# insert() + +A MilvusClient interface. This method inserts entities into a specified collection. + +```Java +R insert(InsertRowsParam requestParam); +``` + +## InsertRowsParam + +Use the `InsertRowsParam.Builder` method to construct an `InsertRowsParam` object. + +```Java +import io.milvus.param.highlevel.dml.InsertRowsParam; +InsertRowsParam.Builder builder = InsertRowsParam.newBuilder(); +``` + +Methods of `InsertRowsParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withCollectionName(String collectionName)` | Sets the target collection name.
    The value cannot be empty or null. | `collectionName`: Name of the collection to which the data is to be inserted in rows. | +| `withRows(List rows)` | Sets the data to insert in rows.
    The list cannot be empty.
    Exclude the primary key if it automatically increments. | `rows`: A list of `JSONObject` objects, each representing a row in the dataset. | +| `build()` | Constructs an `InsertRowsParam` object. | N/A | + +The `InsertRowsParam.Builder.build()` method can throw the following exceptions: + +- `ParamException` is raised if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. +- If the API succeeds, it returns a valid `InsertResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.MutationResultWrapper; +import io.milvus.grpc.MutationResult; + +List rowsData = new ArrayList<>(); +Random ran = new Random(); +for (long i = 0L; i < rowCount; ++i) { + JSONObject row = new JSONObject(); + row.put(AGE_FIELD, ran.nextInt(99)); + row.put(VECTOR_FIELD, generateFloatVector()); + + // $meta if collection EnableDynamicField, you can input this field not exist in schema, else deny + row.put(INT32_FIELD_NAME, ran.nextInt()); + row.put(INT64_FIELD_NAME, ran.nextLong()); + row.put(VARCHAR_FIELD_NAME, "测试varchar"); + row.put(FLOAT_FIELD_NAME, ran.nextFloat()); + row.put(DOUBLE_FIELD_NAME, ran.nextDouble()); + row.put(BOOL_FIELD_NAME, ran.nextBoolean()); + + // $json + JSONObject jsonObject = new JSONObject(); + jsonObject.put(INT32_FIELD_NAME, ran.nextInt()); + jsonObject.put(INT64_FIELD_NAME, ran.nextLong()); + jsonObject.put(VARCHAR_FIELD_NAME, "测试varchar"); + jsonObject.put(FLOAT_FIELD_NAME, ran.nextFloat()); + jsonObject.put(DOUBLE_FIELD_NAME, ran.nextDouble()); + jsonObject.put(BOOL_FIELD_NAME, ran.nextBoolean()); + row.put(USER_JSON_FIELD, jsonObject); + + rowsData.add(row); +} + +InsertRowsParam param = InsertRowsParam.newBuilder() + .withCollectionName(COLLECTION_NAME) + .withRows(rowsData) + .build(); +R response = client.insert(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +System.out.println("insertCount: " + response.getData().getInsertCount()); +System.out.println("insertIds: " + response.getData().getInsertIds()); +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/High-level API/listCollections().md b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/listCollections().md new file mode 100644 index 000000000..3c4de94fa --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/listCollections().md @@ -0,0 +1,51 @@ +# listCollections() + +A MilvusClient interface. This method lists all the collections. + +```Java +R listCollections(ListCollectionsParam requestParam); +``` + +## ListCollectionsParam + +Use the `ListCollectionsParam.Builder` to construct a `ListCollectionsParam` object. + +```Java +import io.milvus.param.highlevel.collection.ListCollectionsParam; +ListCollectionsParam.Builder builder = ListCollectionsParam.newBuilder(); +``` + +Methods of `ListCollectionsParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `build()` | Construct a `ListCollectionsParam` object. | N/A | + +The `ListCollectionsParam.Builder.build()` method can throw the following exceptions: + +- `ParamException` is raised if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. +- If the API succeeds, it returns a valid `ListCollectionsResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.highlevel.collection.*; + +ListCollectionsParam param = ListCollectionsParam.newBuilder() + .build(); + +R response = client.listCollections(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +for (String collectionName : response.getData().collectionNames) { + System.out.println(collectionName); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/High-level API/query().md b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/query().md new file mode 100644 index 000000000..33082d367 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/query().md @@ -0,0 +1,65 @@ +# query() + +A MilvusClient interface. This method filters entities by a boolean expression. Note that the order of the returned entities can not be guaranteed. + +```Java +R query(QuerySimpleParam requestParam); +``` + +## QuerySimpleParam + +Use the `QuerySimpleParam.Builder` to construct a `QuerySimpleParam` object. + +```Java +import io.milvus.param.highlevel.dml.QuerySimpleParam; +QuerySimpleParam.Builder builder = QuerySimpleParam.newBuilder(); +``` + +Methods of `QuerySimpleParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withCollectionName(String collectionName)` | Sets the name of the target collection.
    The value cannot be empty or null. | `collectionName`: Name of the collection against which the query is conducted. | +| `withOutputFields(List outputFields)` | Sets the names of the fields to return. If this value is set, the query result contains the values of these fields. | `outputFields`: Fields to include in the query result. | +| `withFilter(String filter)` | Sets an expression to filter entities. For more information, refer to [this doc](https://milvus.io/docs/boolean.md). | `filter`: A boolean expression to filter entities. | +| `withOffset(Long offset)` | Sets a position prior to which entities are to ignore in the query. | `offset`: A position prior to which entities are to ignore. | +| `withLimit(Long limit)` | Sets the number or entities to return.
    The value should be 0 or a positive integer.
    The value defaults to `0`, which lifts the limits on the number of entities to return. | `limit`: Number of entities to return. | +| `withConsistencyLevel(ConsistencyLevelEnum consistencyLevel)` | Sets the consistency level of the collection to query against. If not specified, the default consistency level is to be used. For details, please refer to `ConsistencyLevelEnum` in **Misc**. | `consistencyLevel`: The consistency level of the collection to query against. | +| `build()` | Constructs a `QuerySimpleParam` object. | N/A | + +The `QuerySimpleParam.Builder.build()` method can throw the following exceptions: + +- `ParamException` is raised if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. +- If the API succeeds, it returns valid `QueryResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.QueryResultsWrapper; +import io.milvus.response.FieldDataWrapper; +import io.milvus.grpc.QueryResults; + +QuerySimpleParam querySimpleParam = QuerySimpleParam.newBuilder() + .withCollectionName(COLLECTION_NAME) + .withOutFields(Lists.newArrayList("*")) + .withFilter(filter) + .withLimit(100L) + .withOffset(0L) + .build(); +R response = client.query(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +for (QueryResultsWrapper.RowRecord rowRecord : response.getData().getRowRecords()) { + System.out.println(rowRecord); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/High-level API/search().md b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/search().md new file mode 100644 index 000000000..ab83de556 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/High-level API/search().md @@ -0,0 +1,66 @@ +# search() + +A MilvusClient interface. This method conducts an approximate nearest neighbor (ANN) search on a vector field with filters in the form of a boolean expression. + +```Java +R search(SearchSimpleParam requestParam); +``` + +## SearchSimpleParam + +Use the `SearchSimpleParam.Builder` to construct a `SearchSimpleParam` object. + +```Java +import io.milvus.param.highlevel.dml.SearchSimpleParam; +SearchSimpleParam.Builder builder = SearchSimpleParam.newBuilder(); +``` + +Methods of `SearchSimpleParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withCollectionName(String collectionName)` | Sets the name of the target collection.
    The value cannot be empty or null. | `collectionName`: Name of the collection against which the search is conducted. | +| `withOutputFields(List outputFields)` | Sets the names of the fields to return. If this value is set, the search result contains the values of these fields. | `outputFields`: Fields to include in the search result. | +| `withFilter(String filter)` | Sets an expression to filter entities. For more information, refer to [this doc](https://milvus.io/docs/boolean.md). | `filter`: A boolean expression to filter entities. | +| `withVectors(List vectors)` | Sets the query vector.
    The maximum number of vectors to include in a search should be less than 16384. | `vectors`:
    • If the vector field holds float vectors, the type of `vectors` should be `List>`.
    • If the vector field holds binary vectors, the type of `vectors` should be `List`.
    | +| `withOffset(Long offset)` | Sets a position prior to which entities are to ignore in the search. | `offset`: A position prior to which entities are to ignore. | +| `withLimit(Long limit)` | Sets the number or entities to return.
    The value should be 0 or a positive integer.
    The value defaults to `10`, indicates that 10 results are to return if not specified. | `limit`: Number of entities to return. | +| `withConsistencyLevel(ConsistencyLevelEnum consistencyLevel)` | Sets the consistency level of the collection to search against. If not specified, the default consistency level is to be used. For details, please refer to `ConsistencyLevelEnum` in **Misc**. | `consistencyLevel`: The consistency level of the collection to search against. | +| `build()` | Constructs a `SearchSimpleParam` object. | N/A | + +The SearchSimpleParam.Builder.build() can throw the following exceptions: + +- `ParamException` is raised if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. +- If the API succeeds, it returns valid `SearchResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.SearchResultsWrapper; +import io.milvus.grpc.SearchResults; + +SearchSimpleParam param = SearchSimpleParam.newBuilder() + .withCollectionName(COLLECTION_NAME) + .withVectors(generateFloatVector()) + .withOutputFields(Lists.newArrayList("*")) + .withFilter(filter) + .withLimit(100L) + .withOffset(0L) + .build(); +R response = client.search(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +for (QueryResultsWrapper.RowRecord rowRecord : response.getData().getRowRecords()) { + System.out.println(rowRecord); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Index/createIndex().md b/API_Reference/milvus-sdk-java/v2.3.x/Index/createIndex().md new file mode 100644 index 000000000..052b3cad6 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Index/createIndex().md @@ -0,0 +1,63 @@ +# createIndex() + +A MilvusClient interface. This method creates an index on a field in a specified collection. + +```Java +R createIndex(CreateIndexParam requestParam); +``` + +## CreateIndexParam + +Use the `CreateIndexParam.Builder` to construct a `CreateIndexParam` object. + +```Java +import io.milvus.param.CreateIndexParam; +CreateIndexParam.Builder builder = CreateIndexParam.newBuilder() +``` + +Methods of `CreateIndexParam.Builder`: + +| Method | Description | Parameters | +| -------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName( String collectionName)` | Sets the target collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to create an index for. | +| `withFieldName(String fieldName)` | Sets the target field name. The field name cannot be empty or null. | `fieldName`: The name of the field to build an index on. | +| `withIndexType(IndexType indexType)` | Sets the index type. | `indexType`: [Index type](../Misc/IndexType.md). | +| `withIndexName(String indexName)` | Sets the name of index to create. The index name can be used to check the status of index. If no index name is specified, the default index name is an empty string. The maximum length of an index name is 255 characters. | `indexName`: Name of the index to create. | +| `withMetricType(MetricType metricType)` | Sets the metric type. | `metricType`: [Metric type](../Misc/MetricType.md). | +| `withExtraParam(String extraParam)` | Sets the specific index parameters for the index type. For example, for IVF indexes, extra parameters can be `{\"nlist\":1024}`. | `extraParam`: Extra parameters in JSON format. | +| `withSyncMode(Boolean syncMode)` | Enables sync mode. For sync mode, the client keeps waiting until all segments of the collection are successfully indexed. If sync mode is disabled, `createIndex()` returns the results immediately. Sync mode is enabled by default. | `syncMode`: Sync mode is enabled when the value is `true`. | +| `withSyncWaitingInterval(Long milliseconds)` | Sets the waiting interval in sync mode. With sync mode enabled, the client constantly checks index state at intervals. The interval value must be greater than zero, and cannot be greater than `Constant.MAX_WAITING_INDEX_INTERVAL`. Interval value is `500` milliseconds by default. | `milliseconds`: Sync mode interval value (unit: millisecond). | +| `withSyncWaitingTimeout(Long seconds)` | Sets the timeout value for sync mode. The timeout value must be greater than zero with no upper limit. The default value is `600` seconds. | `seconds`: Sync mode timeout value (unit: second). | +| `build()` | Constructs a `CreateIndexParam` object. | N/A | + +The `CreateIndexParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +CreateIndexParam param = CreateIndexParam.newBuilder() + .withCollectionName("collection1") + .withFieldName("field1") + .withIndexType(IndexType.IVF_FLAT) + .withMetricType(MetricType.L2) + .withExtraParam("{\"nlist\":64}") + .build(); +R response = client.createIndex(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Index/describeIndex().md b/API_Reference/milvus-sdk-java/v2.3.x/Index/describeIndex().md new file mode 100644 index 000000000..41b706486 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Index/describeIndex().md @@ -0,0 +1,88 @@ +# describeIndex() + +A MilvusClient interface. This method shows the information of a specified index. + +```Java +R describeIndex(DescribeIndexParam requestParam); +``` + +## DescribeIndexParam + +Use the `DescribeIndexParam.Builder` to construct a `DescribeIndexParam` object. + +```Java +import io.milvus.param.DescribeIndexParam; +DescribeIndexParam.Builder builder = DescribeIndexParam.newBuilder(); +``` + +Methods of `DescribeIndexParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------ | ------------------------------------------------------------ | ----------------------------------------- | +| `withCollectionName(collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection whose index information needs to be checked. | +| `withIndexName(String indexName)` | Sets the target index name. The index name cannot be empty or null. If no index name is specified, the default index name is an empty string. | `indexName`: Name of the index whose information needs to be checked. | +| `build()` | Constructs a `DescribeIndexParam` object. | N/A | + +The `DescribeIndexParam.Builder.build()` could throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `DescribeIndexResponse` held by the R template. You can use `DescIndexResponseWrapper` to get index descriptions easily. + +## DescIndexResponseWrapper + +A tool class to encapsulate the `DescribeIndexResponse`. + +```Java +import io.milvus.response.DescIndexResponseWrapper; +DescIndexResponseWrapper wrapper = new DescIndexResponseWrapper(descIndexResponse); +``` + +Methods of `DescIndexResponseWrapper`: + +| **Method** | **Description** | **Parameters** | **Returns** | +| ------------------------------------------- | ------------------------------------------------------------ | -------------------------- | ----------------- | +| `getIndexDescriptions()` | Gets a list of all index descriptions. Currently, only the information of one index can be returned. | N/A | `List` | +| `getIndexDescByFieldName(String fieldName)` | Gets index description by field name. `null` is returned if the field does not exist. | `fieldName`: A field name. | `IndexDesc` | + +## IndexDesc + +A tool class to describe an index. + +Methods of `DescIndexResponseWrapper.IndexDesc`: + +| **Method** | **Description** | **Returns** | +| ----------------- | ------------------------------------- | ------------ | +| `getIndexType()` | Gets the index type. | [IndexType](../Misc/IndexType.md) | +| `getMetricType()` | Gets the metric type | [MetricType](../Misc/MetricType.md) | +| `getExtraParam()` | Gets the index parameters in `JSON` format. | `String` | + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.DescIndexResponseWrapper; +import io.milvus.grpc.DescribeIndexResponse; + +DescribeIndexParam param = DescribeIndexParam.newBuilder() + .withCollectionName("collection1") + .withIndexName("index1") + .build(); +R response = client.describeIndex(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +DescIndexResponseWrapper wrapper = new DescIndexResponseWrapper(response.getData()); +for (DescIndexResponseWrapper.IndexDesc desc : wrapper.getIndexDescriptions()) { + System.out.println(desc.toString()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Index/dropIndex().md b/API_Reference/milvus-sdk-java/v2.3.x/Index/dropIndex().md new file mode 100644 index 000000000..5b8d1c747 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Index/dropIndex().md @@ -0,0 +1,54 @@ +# dropIndex() + +A MilvusClient interface. This method drops an index and its corresponding index file in the collection. + +```Java +R dropIndex(DropIndexParam requestParam); +``` + +## DropIndexParam + +Use the `DropIndexParam.Builder` to construct a `DropIndexParam` object. + +```Java +import io.milvus.param.DropIndexParam; +DropIndexParam.Builder builder = DropIndexParam.newBuilder(); +``` + +Methods of `DropIndexParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------ | ------------------------------------------------------------ | --------------------------------------------- | +| `withCollectionName(collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection whose index needs to be dropped. | +| `withIndexName(String indexName)` | Sets the name of the index to drop. If no index name is specified, the default index name is an empty string. | `indexName`: The name of the index to drop. | +| `build()` | Constructs a `DropIndexParam` object. | N/A | + +The `DropIndexParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + + +## Example + +```Java +import io.milvus.param.*; + +DropIndexParam param = DropIndexParam.newBuilder() + .withCollectionName("collection1") + .withIndexName("index1") + .build(); +R response = client.dropIndex(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Index/getIndexBuildProgress().md b/API_Reference/milvus-sdk-java/v2.3.x/Index/getIndexBuildProgress().md new file mode 100644 index 000000000..ab7f1e309 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Index/getIndexBuildProgress().md @@ -0,0 +1,58 @@ +# getIndexBuildProgress() + +A MilvusClient interface. This method shows the index building progress, such as how many rows are indexed. + +```Java +R getIndexBuildProgress(GetIndexBuildProgressParam requestParam); +``` + +## GetIndexBuildProgressParam + +Use the `GetIndexBuildProgressParam.Builder` to construct a `GetIndexBuildProgressParam` object. + +```Java +import io.milvus.param.GetIndexBuildProgressParam; +GetIndexBuildProgressParam.Builder builder = GetIndexBuildProgressParam.newBuilder(); +``` + +Methods of `GetIndexBuildProgressParam.Builder`: + +| Method | Description | Parameters | +| ---------------------------------- | ------------------------------------------------------------ | -------------------------------------- | +| `withCollectionName(collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection whose index building progress needs to be checked. | +| `withIndexName(String indexName)` | Sets the target index name. The index name cannot be empty or null. If no index name is specified, the default index name is an empty string. | `indexName`: The name of the index whose building progress needs to be checked. | +| `build()` | Constructs a `GetIndexBuildProgressParam` object. | N/A | + +The `GetIndexBuildProgressParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetIndexBuildProgressResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetIndexBuildProgressResponse; + +GetIndexBuildProgressParam param = GetIndexBuildProgressParam.newBuilder() + .withCollectionName("collection1") + .withIndexName("index1") + .build(); +R response = client.getIndexBuildProgress(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +long indexedRows = response.getData().getIndexedRows(); +long totalRows = response.getData().getTotalRows(); +System.out.println("indexed rows: " + indexedRows + ", total rows: " + totalRows); +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Index/getIndexState().md b/API_Reference/milvus-sdk-java/v2.3.x/Index/getIndexState().md new file mode 100644 index 000000000..4c4a6a228 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Index/getIndexState().md @@ -0,0 +1,58 @@ +# getIndexState() + +A MilvusClient interface. This method shows the index building state and the reason for failure, if there is any. + +```Java +R getIndexState(GetIndexStateParam requestParam); +``` + +## GetIndexStateParam + +Use the `GetIndexStateParam.Builder` to construct a` GetIndexStateParam` object. + +```Java +import io.milvus.param.GetIndexStateParam; +GetIndexStateParam.Builder builder = GetIndexStateParam.newBuilder(); +``` + +Methods of `GetIndexStateParam.Builder`: + +| Method | Description | Parameters | +| ---------------------------------- | ------------------------------------------------------------ | -------------------------------------- | +| `withCollectionName(collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection whose index building state needs to be checked. | +| `withIndexName(String indexName)` | Sets the target index name. The index name cannot be empty or null. If no index name is specified, the default index name is an empty string. | `indexName`: The name of the index whose building state needs to be checked. | +| `build()` | Constructs a `GetIndexStateParam` object. | N/A | + +The `GetIndexStateParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetIndexStateResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetIndexStateResponse; + +GetIndexStateParam param = GetIndexStateParam.newBuilder() + .withCollectionName("collection1") + .withIndexName("index1") + .build(); +R response = client.getIndexState(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +if (response.getData().getState() == IndexState.Failed) { + System.out.println(response.getData().getFailReason()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Management/getCompactionState().md b/API_Reference/milvus-sdk-java/v2.3.x/Management/getCompactionState().md new file mode 100644 index 000000000..b41516db3 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Management/getCompactionState().md @@ -0,0 +1,69 @@ +# getCompactionState() + +A MilvusClient interface. This method returns the state of a compaction operation and shows if the specified compaction operation has completed. + +```Java +R getCompactionState(GetCompactionStateParam requestParam); +``` + +## GetCompactionStateParam + +Use the `GetCompactionStateParam.Builder` to construct a `GetCompactionStateParam` object. + +```Java +import io.milvus.param.GetCompactionStateParam; +GetCompactionStateParam.Builder builder = GetCompactionStateParam.newBuilder(); +``` + +Methods of `GetCompactionStateParam.Builder`: + +| Method | Description | Parameters | +| ----------------------------------- | ------------------------------------------ | ------------------------------------- | +| `withCompactionID(Long compactionID)` | Sets the ID of the compaction. | `compactionID`: The ID of the compaction operation to be checked. | +| `build()` | Constructs a `GetCompactionStateParam` object. | N/A | + +The `GetCompactionStateParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetCompactionStateResponse` held by the R template. + +## CompactionState + +Use the `getState()` of `GetCompactionStateResponse` to get the compaction state: + +```Java +package io.milvus.grpc; +public enum CompactionState +``` + +| Type | Code | Description | +| --------------- | -------- | -------------------------- | +| UndefiedState | 0 | For internal usage. | +| Executing | 1 | Compaction is in execution. | +| Completed | 2 | Compaction is completed. | + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetCompactionStateResponse; + +GetCompactionStateParam param = GetCompactionStateParam.newBuilder() + .withCompactionID(compactionID) + .build(); +R response = client.getCompactionState(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +System.out.println("Compaction state: " + response.getData().getState()); +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Management/getCompactionStateWithPlans().md b/API_Reference/milvus-sdk-java/v2.3.x/Management/getCompactionStateWithPlans().md new file mode 100644 index 000000000..cbb34c3c5 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Management/getCompactionStateWithPlans().md @@ -0,0 +1,61 @@ +# getCompactionStateWithPlans() + +A MilvusClient interface. This method returns the detailed information of a compaction operation, including the state indicating if the operation is completed or not, its sub tasks (i.e. the plans), and more. + +```Java +R getCompactionStateWithPlans(GetCompactionPlansParam requestParam) +``` + +## GetCompactionPlansParam + +Use the `GetCompactionPlansParam.Builder` to construct a `GetCompactionPlansParam` object. + +```Java +import io.milvus.param.GetCompactionPlansParam; +GetCompactionPlansParam.Builder builder = GetCompactionPlansParam.newBuilder(); +``` + +Methods of `GetCompactionPlansParam.Builder`: + +| Method | Description | Parameters | +| ----------------------------------- | -------------------------------------------- | ------------------------------------- | +| `withCompactionID(Long compactionID)` | Sets the ID of the compaction operation. | `compactionID`: The ID of the compaction operation whose detailed information needs to be checked. | +| `build()` | Constructs a `GetCompactionPlansParam` object. | N/A | + +The `GetCompactionPlansParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetCompactionPlansResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetCompactionPlansResponse; +import io.milvus.grpc.CompactionMergeInfo; + +GetCompactionPlansParam param = GetCompactionPlansParam.newBuilder() + .withCompactionID(compactionID) + .build(); +R response = client.getCompactionStateWithPlans(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +GetCompactionPlansResponse compactionPlans = response.getData(); +System.out.println("Compaction state: " + compactionPlans.getState()); + +for (int i = 0; i < compactionPlans.getMergeInfosCount(); i++) { + CompactionMergeInfo info = compactionPlans.getMergeInfos(i); + System.out.println("Merge segments " + info.getSourcesList().toString() + " into new segment " + info.getTarget()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Management/getFlushAllState().md b/API_Reference/milvus-sdk-java/v2.3.x/Management/getFlushAllState().md new file mode 100644 index 000000000..c1fad4a48 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Management/getFlushAllState().md @@ -0,0 +1,48 @@ +getFlushAllState() + +A MilvusClient interface. This method tests whether the specified segments are flushed. + +```Java +R getFlushAllState(GetFlushAllStateParam requestParam); +``` + +## GetFlushAllStateParam + +Use the `GetFlushAllStateParam.Builder` to construct a `GetFlushAllStateParam` object. + +```Java +import io.milvus.param.GetFlushAllStateParam; +GetFlushAllStateParam.Builder builder = GetFlushAllStateParam.newBuilder(); +``` + +Methods of `GetFlushAllStateParam.Builder`: + +| Method | Description | Parameters | +|-----------|---------------------------------------------|------------| +| `build()` | Construct a `GetFlushAllStateParam` object. | N/A | + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetFlushAllStateResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetFlushAllStateResponse; + +GetFlushAllStateParam param = GetFlushAllStateParam.newBuilder() + .build(); + +R response = client.getFlushAllState(param); + +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Management/getFlushState().md b/API_Reference/milvus-sdk-java/v2.3.x/Management/getFlushState().md new file mode 100644 index 000000000..a07735d36 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Management/getFlushState().md @@ -0,0 +1,55 @@ +# getFlushState() + +A MilvusClient interface. This method checks whether the specified segments are flushed. + +```Java +R getFlushState(GetFlushStateParam requestParam); +``` + +## GetFlushStateParam + +Use the `GetFlushStateParam.Builder` to construct a `GetFlushStateParam` object. + +```Java +import io.milvus.param.GetFlushStateParam; +GetFlushStateParam.Builder builder = GetFlushStateParam.newBuilder(); +``` + +Methods of `GetFlushStateParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------- | ------------------------------------------------------------ | ----------------------------------- | +|`withSegmentIDs(List segmentIDs)` | Sets the ID list of the segments to check, which can be obtained by calling the flush() method. | `segmentIDs`: A list of the IDs of the segments whose flush state needs to be checked. | +| `addSegmentID(Long segmentID)` | Adds the ID of the segment to check, which can be obtained by calling the flush() method. | `segmentID`: The ID of the segment whose flush state needs to be checked. | +| `build()` | Constructs a `GetFlushStateParam` object. | N/A | + +The `GetFlushStateParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetFlushStateResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetFlushStateResponse; + +GetFlushStateParam param = GetFlushStateParam.newBuilder() + .addSegmentID(collectionName) + .build(); +R response = client.getFlushState(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +System.out.println("Flushed: " + response.getData().getFlushed()); +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Management/getMetrics().md b/API_Reference/milvus-sdk-java/v2.3.x/Management/getMetrics().md new file mode 100644 index 000000000..3ef04ca72 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Management/getMetrics().md @@ -0,0 +1,56 @@ +# getMetrics() + +A MilvusClient interface. This method returns the information about runtime Milvus metrics in `JSON` format. + +```Java +R getMetrics(GetMetricsParam requestParam); +``` + +## GetMetricsParam + +Use the `GetMetricsParam.Builder` to construct a `GetMetricsParam` object. + +```Java +import io.milvus.param.GetMetricsParam; +GetMetricsParam.Builder builder = GetMetricsParam.newBuilder(); +``` + +Methods of `GetMetricsParam.Builder`: + +| Method | Description | Parameters | +| --------------------------- | ------------------------------------------------------------ | -------------------------------------- | +| `withRequest(String request)` | Sets the request to retrieve metric information from the server in JSON format. | `request`: Request string in JSON format. | +| `build()` | Constructs a `GetMetricsParam` object. | N/A | + +The `GetMetricsParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetMetricsResponse` held by the R template. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetMetricsResponse; + +GetMetricsParam param = GetMetricsParam.newBuilder() + .withRequest("{\"metric_type\":\"system_info\"}") + .build(); +R response = client.getMetrics(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +System.out.println(response.getData().getResponse()); +``` + + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Management/loadBalance().md b/API_Reference/milvus-sdk-java/v2.3.x/Management/loadBalance().md new file mode 100644 index 000000000..02f0f333e --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Management/loadBalance().md @@ -0,0 +1,61 @@ +# loadBalance() + +A MilvusClient interface. This method moves segments from one query node to another to balance the query load on multiple query nodes. + +
    +The Milvus server adopts an internal mechanism for load balance. Sometimes, segments that have been moved from one query node to another might be moved back. +
    + +```Java +R loadBalance(LoadBalanceParam requestParam); +``` + +## LoadBalanceParam + +Use the `LoadBalanceParam.Builder` to construct a `LoadBalanceParam` object. + +```Java +import io.milvus.param.LoadBalanceParam; +LoadBalanceParam.Builder builder = LoadBalanceParam.newBuilder(); +``` + +Methods of `LoadBalanceParam.Builder`: + +| Method | Description | Parameters | +| ----------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------------- | +| `withSourceNodeID(Long srcNodeID)` | Sets the ID of the source query node in which the sealed segments were loaded. | `srcNodeID`: The ID of the source query node. | +| `addDestinationNodeID(Long destNodeID)` | Adds the ID of the target query node to which the sealed segments will be moved for load balance. | `destNodeID`: The ID of the target query node. | +| `withDestinationNodeID(List destNodeIDs)` | Sets the ID array of the target query nodes to which the sealed segments will be moved for load balance. | `destNodeIDs`: An array of the IDs of the target query nodes. | +| `addSegmentID(Long segmentID)` | Adds the ID of the sealed segment to be moved for load balance. | `segmentID`: The ID of the sealed segment to be moved. | +| `withSegmentIDs(List segmentIDs)` | Sets the ID array of the sealed segments to be moved for load balance. | `segmentIDs`: An array of the IDs of the sealed segments that needs to be moved. | +| `build()` | Constructs a `LoadBalanceParam` object. | N/A | + +The`LoadBalanceParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +#### Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +#### Example + +```Java +import io.milvus.param.*; + +LoadBalanceParam param = LoadBalanceParam.newBuilder() + .withSegmentIDs(segmentIDs) + .withDestinationNodeID(destNodeID) + .withSourceNodeID(srcNodeID) + .build(); +R response = client.loadBalance(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Management/manualCompact().md b/API_Reference/milvus-sdk-java/v2.3.x/Management/manualCompact().md new file mode 100644 index 000000000..2f14b9ccc --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Management/manualCompact().md @@ -0,0 +1,60 @@ +# manualCompact() + +A MilvusClient interface. This method manually triggers a compaction operation on the server side. + +
    +Compaction is automatically triggerd by the Milvus server under certain conditions. +
    + +```Java +R manualCompact(ManualCompactParam requestParam); +``` + +## ManualCompactParam + +Use the `ManualCompactParam.Builder` to construct a `ManualCompactParam` object. + +```Java +import io.milvus.param.ManualCompactParam; +ManualCompactParam.Builder builder = ManualCompactParam.newBuilder(); +``` + +Methods of `ManualCompactParam.Builder`: + +| Method | Description | Parameters | +| ----------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | collectionName: The name of the collection that needs to be manually compacted. | +| `build()` | Constructs a `ManualCompactParam` object. | N/A | + + +The `ManualCompactParam.Builder.build()` could throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and error message of the exception. + +- If the API succeeds, it returns a valid `ManualCompactionResponse` held by the R template. The `ManualCompactionResponse` contains an ID of this compaction operation, of which you can check the state by `getCompactionState()` or `getCompactionStateWithPlans()` method. + +## Example + +```Java +import io.milvus.param.*; + +ManualCompactParam param = ManualCompactParam.newBuilder() + .withSegmentIDs(segmentIDs) + .withDestinationNodeID(destNodeID) + .withSourceNodeID(srcNodeID) + .build(); +R response = client.manualCompact(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +System.out.println("Compaction ID: " + response.getData().getCompactionID()); +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Misc/ConsistencyLevelEnum.md b/API_Reference/milvus-sdk-java/v2.3.x/Misc/ConsistencyLevelEnum.md new file mode 100644 index 000000000..d6be20cd9 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Misc/ConsistencyLevelEnum.md @@ -0,0 +1,14 @@ +# ConsistencyLevelEnum + +The enumeration of consistency levels during a search or query. + +```Java +package io.milvus.common.clientenum; +public enum ConsistencyLevelEnum +``` + +| Type | Description | +| ---------- | ------------------------------------------------------------ | +| STRONG | Waits until all operations are completed before a search/query. | +| BOUNDED | Waits until operations in a time span are completed before a search/query. | +| EVENTUALLY | Executes a search/query immediately. | \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Misc/DataType.md b/API_Reference/milvus-sdk-java/v2.3.x/Misc/DataType.md new file mode 100644 index 000000000..fb1227165 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Misc/DataType.md @@ -0,0 +1,24 @@ +# DataType + +The eunumeration of all supported data types defined by RPC proto in Milvus. + +```Java +package io.milvus.grpc; +public enum DataType +``` + +| Type | Description | +| ------------ | ------------------------------------------------------------ | +| None | For internal usage. | +| Bool | Boolean. | +| Int8 | Integer number stored with 8 bit. | +| Int16 | Integer number stored with 16 bit. | +| Int32 | Integer number stored with 32 bit. | +| Int64 | Integer number stored with 64 bit. | +| Float | Floating-point numbers. | +| Double | 64-bit IEEE 754 floating point numbers. | +| String | Reserved. Do not use this. | +| VarChar | Variable-length string with a limit on the maximum length. | +| BinaryVector | Binary vector. Each dimension is represented by 1 bit. | +| FloatVector | Float vector. Each dimension is represented by 1 float (4 bits) value. | + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Misc/IndexType.md b/API_Reference/milvus-sdk-java/v2.3.x/Misc/IndexType.md new file mode 100644 index 000000000..0d532e615 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Misc/IndexType.md @@ -0,0 +1,23 @@ +# IndexType + +The enumeration of all available index types in Milvus. + +```Java +package io.milvus.param; +public enum IndexType +``` + +| Type | Description | +| ------------ | ----------------------------------- | +| INVALID | For internal usage. | +| FLAT | Only for `FloatVector` type field. | +| IVF_FLAT | Only for `FloatVector` type field. | +| IVF_SQ8 | Only for `FloatVector` type field. | +| IVF_PQ | Only for `FloatVector` type field. | +| HNSW | Only for `FloatVector` type field. | +| ANNOY | Only for `FloatVector` type field. | +| DISKANN | Only for `FloatVector` type field. | +| BIN_FLAT | Only for `BinaryVector` type field. | +| BIN_IVF_FLAT | Only for `BinaryVector` type field. | +| TRIE | Only for `VARCHAR` type field. | + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Misc/LogLevel.md b/API_Reference/milvus-sdk-java/v2.3.x/Misc/LogLevel.md new file mode 100644 index 000000000..2a8cac55c --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Misc/LogLevel.md @@ -0,0 +1,16 @@ +# LogLevel + +The enumeration for setting the log level at runtime. + +```Java +package io.milvus.param; +public enum LogLevel +``` + +| Type | Description | +|---------|------------------------------------------------------------------------------| +| Debug | One of the debug levels. All logs are visisble. | +| Info | One of the debug levels. Informational, warning, and error logs are visible. | +| Warning | One of the debug levels. Warning and error logs are visible. | +| Error | Error level. Only error logs are visible. | + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Misc/MetricType.md b/API_Reference/milvus-sdk-java/v2.3.x/Misc/MetricType.md new file mode 100644 index 000000000..d58299192 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Misc/MetricType.md @@ -0,0 +1,19 @@ +# MetricType + +The enumeration of all available metric types in Milvus. + +```Java +package io.milvus.param; +public enum MetricType +``` + +| Type | Description | +| -------------- | ------------------------------------------------- | +| INVALID | For internal usage. | +| L2 | Euclidean distance. Only for float vectors. | +| IP | Inner product. Only for normalized float vectors. | +| HAMMING | Only for binary vectors. | +| JACCARD | Only for binary vectors. | +| TANIMOTO | Only for binary vectors. | +| SUBSTRUCTURE | Only for binary vectors. | +| SUPERSTRUCTURE | Only for binary vectors. | diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Misc/R.md b/API_Reference/milvus-sdk-java/v2.3.x/Misc/R.md new file mode 100644 index 000000000..9e16c148a --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Misc/R.md @@ -0,0 +1,74 @@ +# R + +A template class to hold the status code, error message, and the response returned by each client interface. + +```Java +package io.milvus.param; +public class R +``` + +## R.Status + +`R.Status` is an enumeration of the status codes. Each `R` object holds an integer value that can be mapped to the `R.Status`. + +
    +Not all status codes are used, some of them are reserved. +
    + +| **Status** | **Code** | **Description** | +| ----------------------- | -------- | ------------------------------------------------------------ | +| `IllegalResponse` | -6 | The response returned by the server is incorrect. Parsing the response on the client side fails. | +| `ParamError` | -5 | The parameter is illegal on the client side. | +| `VersionMismatch` | -4 | **This error is reserved and not used for now.* | +| `Unknown` | -3 | General error for an unknown reason. | +| `ClientNotConnected` | -2 | The connection is not ready. | +| `RpcError` | -1 | **This error is reserved and not used for now.* | +| `Success` | 0 | Operation succeeded. | +| `UnexpectedError` | 1 | Error caused by unexpected reason. | +| `ConnectFailed` | 2 | **This error is reserved and not used for now.* | +| `PermissionDenied` | 3 | **This error is reserved and not used for now.* | +| `CollectionNotExists` | 4 | **This error is reserved and not used for now.* | +| `IllegalArgument` | 5 | The parameter is illegal on the server side. | +| `IllegalDimension` | 7 | **This error is reserved and not used for now.* | +| `IllegalIndexType` | 8 | **This error is reserved and not used for now.* | +| `IllegalCollectionName` | 9 | **This error is reserved and not used for now.* | +| `IllegalTOPK` | 10 | **This error is reserved and not used for now.* | +| `IllegalRowRecord` | 11 | **This error is reserved and not used for now.* | +| `IllegalVectorID` | 12 | **This error is reserved and not used for now.* | +| `IllegalSearchResult` | 13 | **This error is reserved and not used for now.* | +| `FileNotFound` | 14 | **This error is reserved and not used for now.* | +| `MetaFailed` | 15 | Getting metadata fails on the server side. | +| `CacheFailed` | 16 | **This error is reserved and not used for now.* | +| `CannotCreateFolder` | 17 | **This error is reserved and not used for now.* | +| `CannotCreateFile` | 18 | **This error is reserved and not used for now.* | +| `CannotDeleteFolder` | 19 | **This error is reserved and not used for now.* | +| `CannotDeleteFile` | 20 | **This error is reserved and not used for now.* | +| `BuildIndexError` | 21 | **This error is reserved and not used for now.* | +| `IllegalNLIST` | 22 | **This error is reserved and not used for now.* | +| `IllegalMetricType` | 23 | **This error is reserved and not used for now.* | +| `OutOfMemory` | 24 | **This error is reserved and not used for now.* | +| `IndexNotExist` | 25 | **This error is reserved and not used for now.* | +| `EmptyCollection` | 26 | **This error is reserved and not used for now.* | + + +## Methods + +| Method | Description | Return | +| -------------- | ------------------------------------------------ | ------------------ | +| `getMessage()` | Gets the error message. | String | +| `getStatus()` | Gets the status code. | Integer | +| `getData()` | Gets the response object returned by the server. | RPC response class | + +## Example + +```Java +import io.milvus.param.*; + +R response = client.dropCollection(DropCollectionParam.newBuilder() + .withCollectionName(collectionName) + .build()); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Partition/createPartition().md b/API_Reference/milvus-sdk-java/v2.3.x/Partition/createPartition().md new file mode 100644 index 000000000..2214b9851 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Partition/createPartition().md @@ -0,0 +1,53 @@ +# createPartition() + +A MilvusClient interface. This method creates a partition in a specified collection. + +```Java +R createPartition(CreatePartitionParam requestParam); +``` + +## CreatePartitionParam + +Use the `CreatePartitionParam.Builder` to construct a `CreatePartitionParam` object. + +```Java +import io.milvus.param.CreatePartitionParam; +CreatePartitionParam.Builder builder = CreatePartitionParam.newBuilder(); +``` + +Methods of `CreatePartitionParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------- | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection in which a partition needs to be created. | +| `withPartitionName(String partitionName)` | Sets the partition name. The partition name cannot be empty or null. | `partitionName`: The name of the partition to create. | +| `build()` | Constructs a `CreatePartitionParam` object. | N/A | + +The `CreatePartitionParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +CreatePartitionParam param = CreatePartitionParam.newBuilder() + .withCollectionName(collectionName) + .withPartitionName(partitionName) + .build(); +R response = client.createPartition(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Partition/dropPartition().md b/API_Reference/milvus-sdk-java/v2.3.x/Partition/dropPartition().md new file mode 100644 index 000000000..df0f9f132 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Partition/dropPartition().md @@ -0,0 +1,57 @@ +# dropPartition() + +A MilvusClient interface. This method drops a partition and the data within. + +
    +This method drops all data in the specified partition and the _default partition cannot be dropped. +
    + +```Java +R dropPartition(DropPartitionParam requestParam); +``` + +## DropPartitionParam + +Use the `DropPartitionParam.Builder` to construct a `DropPartitionParam` object. + +```Java +import io.milvus.param.DropPartitionParam; +DropPartitionParam.Builder builder = DropPartitionParam.newBuilder(); +``` + +Methods of `DropPartitionParam.Builder`: + +| Method | Description | Parameters | +| ----------------------------------------- | ------------------------------------------------------------ | -------------------------------------- | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection in which a partition needs to be dropped. | +| `withPartitionName(String partitionName)` | Sets the partition name. The partition name cannot be empty or null. | `partitionName`: The name of the partition to drop. | +| `build()` | Constructs a `DropPartitionParam` object. | N/A | + +The `DropPartitionParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +DropPartitionParam param = DropPartitionParam.newBuilder() + .withCollectionName(collectionName) + .withPartitionName(partitionName) + .build(); +R response = client.dropPartition(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Partition/getPartitionStatistics().md b/API_Reference/milvus-sdk-java/v2.3.x/Partition/getPartitionStatistics().md new file mode 100644 index 000000000..fd5836962 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Partition/getPartitionStatistics().md @@ -0,0 +1,74 @@ +# getPartitionStatistics() + +A MilvusClient interface. This method shows the statistical information of a specified partition. + +```Java +R getPartitionStatistics(GetPartitionStatisticsParam requestParam); +``` + +## GetPartitionStatisticsParam + +Use the `GetPartitionStatisticsParam.Builder` to construct a `GetPartitionStatisticsParam `object. + +```Java +import io.milvus.param.GetPartitionStatisticsParam; +GetPartitionStatisticsParam.Builder builder = GetPartitionStatisticsParam.newBuilder(); +``` + +Methods of `GetPartitionStatisticsParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------- | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection whose partition statistical information needs to be checked. | +| `withPartitionName(String partitionName)` | Sets the partition name. The partition name cannot be empty or null. | `partitionName`: The name of the partition whose statistical information needs to be checked. | +| `withFlush(Boolean flush)` | Request a flush action before retrieving partition statistics. The value is `True` by default. | `flush`: Set the value to `True` to request a flush action. | +| `build()` | Constructs a `GetPartitionStatisticsParam` object. | N/A | + +The `GetPartitionStatisticsParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `GetPartitionStatisticsResponse` held by the R template. You can use `GetPartStatResponseWrapper` to get statistics easily. + +## GetPartStatResponseWrapper + +A tool class to encapsulate the `GetPartitionStatisticsResponse`. + +```Java +import io.milvus.response.GetPartStatResponseWrapper; +GetPartStatResponseWrapper wrapper = new GetPartStatResponseWrapper(partStatResponse); +``` + +Methods of `GetPartStatResponseWrapper`: + +| Method | Description | Returns | +| --------------- | ------------------------------------------------------------ | ----------- | +| `getRowCount()` | Gets the row count of a partition. `NumberFormatException` is thrown if the row count string is illegal. | `long` | + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.GetPartitionStatisticsResponse; +import io.milvus.response.GetPartStatResponseWrapper; + +GetPartitionStatisticsParam param = GetPartitionStatisticsParam.newBuilder() + .withCollectionName(collectionName) + .withPartitionName("_default") + .build(); +R response = client.getPartitionStatistics(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +GetPartStatResponseWrapper wrapper = new GetPartStatResponseWrapper(response.getData()); +System.out.println("Partition row count: " + wrapper.getRowCount()); +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Partition/hasPartition().md b/API_Reference/milvus-sdk-java/v2.3.x/Partition/hasPartition().md new file mode 100644 index 000000000..68a6ba539 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Partition/hasPartition().md @@ -0,0 +1,55 @@ +# hasPartition() + +A MilvusClient interface. This method checks if a partition exists in the specified collection. + +```Java +R hasPartition(HasPartitionParam requestParam); +``` + +## HasPartitionParam + +Use the `HasPartitionParam.Builder` to construct a `HasPartitionParam` object. + +```Java +import io.milvus.param.HasPartitionParam; +HasPartitionParam.Builder builder = HasPartitionParam.newBuilder(); +``` + +Methods of `HasPartitionParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------- | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to check. | +| `withPartitionName(String partitionName)` | Sets the partition name. The partition name cannot be empty or null. | `partitionName`: The name of the partition to check. | +| `build()` | Constructs a `HasPartitionParam` object. | N/A | + +The `HasPartitionParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +HasPartitionParam param = HasPartitionParam.newBuilder() + .withCollectionName(collectionName) + .withPartitionName(partitionName) + .build(); +R response = client.hasPartition(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +System.out.println("Partition existence: " + response.getData()); +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Partition/loadPartitions().md b/API_Reference/milvus-sdk-java/v2.3.x/Partition/loadPartitions().md new file mode 100644 index 000000000..239be898a --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Partition/loadPartitions().md @@ -0,0 +1,60 @@ +# loadPartitions() + +A MilvusClient interface. This method loads the data in a partition into memory before a search or query. + +```Java +R loadPartitions(LoadPartitionsParam requestParam); +``` + +## LoadPartitionsParam + +Use the `LoadPartitionsParam.Builder` to construct a `LoadPartitionsParam` object. + +```Java +import io.milvus.param.LoadPartitionsParam; +LoadPartitionsParam.Builder builder = LoadPartitionsParam.newBuilder(); +``` + +Methods of `LoadPartitionsParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------------- | ------------------------------------------------------------ | --------------------------------------------------- | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection whose partition needs to be loaded. | +| `withPartitionNames(List partitionNames)` | Sets the partition name list. The partition name list cannot be null or empty. | `partitionNames`: A list of the names of the partitions to load. | +| `addPartitionName(String partitionName)` | Adds a partition by name. The partition name cannot be empty or null. | `partitionName`: The name of the partition to load. | +| `withSyncLoad(Boolean syncLoad)` | Enables sync mode for load action. With sync mode enabled, the client keeps waiting until all segments of the partition are successfully loaded. If sync mode is disabled, the client returns instantly after the `loadPartitions()` is called. Sync mode is enabled by default. | `syncLoad`: Set the value to `True` to enable sync mode. | +| `withSyncLoadWaitingInterval(Long milliseconds)` | Sets the waiting interval for sync mode. In sync mode, the client constantly checks partition load state at intervals. The interval must be greater than zero, and cannot be greater than `Constant.MAX_WAITING_LOADING_INTERVAL`. The default value is `500` milliseconds. | `milliseconds`: The interval value (unit: millisecond). | +| `withSyncLoadWaitingTimeout(Long seconds)` | Sets the timeout value for sync mode. Timeout value must be greater than zero, and cannot be greater than `Constant.MAX_WAITING_LOADING_TIMEOUT`. The default value is `60` seconds. | `seconds`: The timeout value (unit: second). | +| `withReplicaNumber(Integer replicaNumber)` | Specifies the replica number to load. The default value is `1`. | `replicaNumber`: The number of replicas to load when loading the partition. | +| `build()` | Constructs a `LoadPartitionsParam` object. | N/A | + +The `LoadPartitionsParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +LoadPartitionsParam param = LoadPartitionsParam.newBuilder() + .withCollectionName(collectionName) + .addPartitionName(partitionName) + .build(); +R response = client.loadPartitions(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` + + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Partition/releasePartitions().md b/API_Reference/milvus-sdk-java/v2.3.x/Partition/releasePartitions().md new file mode 100644 index 000000000..edb8fed5a --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Partition/releasePartitions().md @@ -0,0 +1,54 @@ +# releasePartitions() + +A MilvusClient interface. This method releases the data in a partition or partitions from memory. + +```Java +R releasePartitions(ReleasePartitionsParam requestParam); +``` + +## ReleasePartitionsParam + +Use the `ReleasePartitionsParam.Builder` to construct a `ReleasePartitionsParam` object. + +```Java +import io.milvus.param.ReleasePartitionsParam; +ReleasePartitionsParam.Builder builder = ReleasePartitionsParam.newBuilder(); +``` + +Methods of `ReleasePartitionsParam.Builder`: + +| Method | Description | Parameters | +| ----------------------------------------------- | ------------------------------------------------------------ | -------------------------------------- | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection whose partition needs to be released. | +| `withPartitionNames(List partitionNames)` | Sets the partition name list. The partition name list cannot be empty or null. | `partitionNames`: A list of the names of the partitions to release. | +| `addPartitionName(String partitionName)` | Adds a partition by name. The partition name cannot be empty or null. | `partitionName`: The name of the partition to release. | +| `build()` | Constructs a `ReleasePartitionsParam` object. | N/A | + +The `ReleasePartitionsParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.*; + +ReleasePartitionsParam param = ReleasePartitionsParam.newBuilder() + .withCollectionName(collectionName) + .addPartitionName(partitionName) + .build(); +R response = client.releasePartitions(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Partition/showPartitions().md b/API_Reference/milvus-sdk-java/v2.3.x/Partition/showPartitions().md new file mode 100644 index 000000000..34bc6228c --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Partition/showPartitions().md @@ -0,0 +1,88 @@ +# showPartitions() + +A MilvusClient interface. This method shows all the partitions in a specified collection. + +```Java +R showPartitions(ShowPartitionsParam requestParam); +``` + +## ShowPartitionsParam + +Use the `ShowPartitionsParam.Builder` to construct a `ShowPartitionsParam` object. + +```Java +import io.milvus.param.ShowPartitionsParam; +ShowPartitionsParam.Builder builder = ShowPartitionsParam.newBuilder(); +``` + +Methods of `ShowPartitionsParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------- | +| `withCollectionName(String collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection whose partitions needs to be listed. | +| `withPartitionNames(List partitionNames)` | Sets the partition name list. The partition name list cannot be empty or null. | `partitionNames`: A list of the names of the partitions to list. | +| `addPartitionName(String partitionName)` | Adds a partition by name. The partition name cannot be empty or null. | `partitionName`: The name of the partition to list. | +| `build()` | Constructs a `ShowPartitionsParam` object. | N/A | + +The `ShowPartitionsParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns a valid `ShowPartitionsResponse` held by the R template. You can use `ShowPartResponseWrapper` to get the information easily. + +## ShowPartResponseWrapper + +A tool class to encapsulate the `ShowPartitionsResponse`. + +```Java +import io.milvus.response.ShowPartResponseWrapper; +ShowPartResponseWrapper wrapper = new ShowPartResponseWrapper(showPartitionsResponse); +``` + +Methods of `ShowPartitionsResponse`: + +| Method | Description | Parameters | Returns | +| ----------------------------------------------- | ------------------------------------------------------- | --------------------------------------- | --------------------- | +| `getPartitionsInfo() ` | Returns a list of `PartitionInfo`. | N/A | `List` | +| `getPartitionInfoByName(String partitionName) ` | Returns a `PartitionInfo` object by the partition name. | `partitionName`: The name of the partition to list. | `PartitionInfo` | + +## PartitionInfo + +A tool class to hold information of a partition. + +Methods of `ShowPartitionsResponse.PartitionInfo`: + +| Method | Description | Returns | +| ----------------- | ------------------------------------- | ------------ | +| `getIndexType()` | Gets the index type. | IndexType | +| `getMetricType()` | Gets the metric type | MetricType | +| `getExtraParam()` | Gets the index parameters in `JSON` format. | `String` | + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.ShowPartitionsResponse; +import io.milvus.response.ShowPartResponseWrapper; + +ShowPartitionsParam param = ShowPartitionsParam.newBuilder() + .withCollectionName(collectionName) + .addPartitionName("_default") + .build(); +R response = client.showPartitions(param); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +ShowPartResponseWrapper wrapper = new ShowPartResponseWrapper(response.getData()); +ShowPartResponseWrapper.PartitionInfo info = wrapper.getPartitionInfoByName("_default"); +System.out.println("Partition name: " + info.getName() + ", ID: " + info.getId() + ", in-memory: " + info.getInMemoryPercentage() + "%"); +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/query().md b/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/query().md new file mode 100644 index 000000000..542b1bb41 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/query().md @@ -0,0 +1,114 @@ +# query() + +A MilvusClient interface. This method queries entity(s) based on scalar field(s) filtered by boolean expression. + +
    +The order of the returned entities cannot be guaranteed. +
    + +```Java +R query(QueryParam requestParam); +``` + +## QueryParam + +Use the `QueryParam.Builder` to construct a `QueryParam` object. + +```Java +import io.milvus.param.QueryParam; +QueryParam.Builder builder = QueryParam.newBuilder(); +``` + +Methods of `QueryParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------------------------ | ------------------------------------------------------------ | -------------------------------------------------------- | +| `withCollectionName(collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to query. | +| `withConsistencyLevel(ConsistencyLevelEnum consistencyLevel)` | Sets the consistency level used in the query. If the consistency level is not specified, the default level is `ConsistencyLevelEnum.BOUNDED`. | `consistencyLevel`: The [consistency level](../Misc/ConsistencyLevelEnum.md) used in the query. | +| `withPartitionNames(List partitionNames)` | Sets a partition name list to specify query scope (Optional). | `partitionNames`: The name list of the partitions to query. | +| `addPartitionName(String partitionName)` | Adds a partition to specify query scope (Optional). | `partitionName`: The name of the partition to query. | +| `withTravelTimestamp(Long ts)` | Specifies an absolute timestamp in a query to get results based on a data view at a specified point in time (Optional). The default value is `0`, with which the server executes the query on a full data view. For more information please refer to [Search with Time Travel](https://milvus.io/docs/v2.1.x/timetravel.md). | `ts`: An absolute timestamp value. | +| `withOutFields(List outFields)` | Specifies the output scalar fields (Optional). If the output fields are specified, the `QueryResults` returned by `query()` will contains the values of these fields. | `outFields`: The name list of output fields. | +| `addOutField(String fieldName)` | Specifies an output scalar field (Optional). | `fieldName`: The name of an output field . | +| `withExpr(String expr)` | Sets the expression to query entities. For more information please refer to [Boolean Expression Rules](https://milvus.io/docs/v2.1.x/boolean.md). | `expr`: The boolean expression used in the query. | +| `withOffset(Long offset)` | Sets a position, the returned entities before which will be ignored. This parameter works only when the `limit` value is specified. The default value is 0, starting from beginning of the returned set of entities. | `offset`: A value that defines the position. | +| `withLimit(Long limit)` | Sets a value to limit the returned number of entities. It must be a positive integer. The default value is 0, indicating that all entities are returned without a limit. | `limit`: A value that defines the limit of returned entities. | +| `withIgnoreGrowing(Boolean ignoreGrowing)` | Whether to ignore growing segments during similarity searches. The value defaults to `false`, indicating that searches involve growing segments. | `ignoreGrowing`: Whether to ignore growing segments or not. | +| `build()` | Constructs a `QueryParam` object. | N/A | + +The `QueryParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns valid `QueryResults` held by the R template. You can use `QueryResultsWrapper` to get the query results. + +## QueryResultsWrapper + +A tool class to encapsulate the `QueryResults`. + +```Java +import io.milvus.response.QueryResultsWrapper; +QueryResultsWrapper wrapper = new QueryResultsWrapper(queryResults); +``` + +Methods of `QueryResultsWrapper`: + +| Method | Description | Parameters | Returns | +| ----------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ---------------- | +| `getFieldWrapper(String fieldName)` | Returns a `FieldDataWrapper` object by a field name. `ParamException` is thrown if the field does not exist. | `fieldName`: a field name which is specified by the `withOutFields()` of `QueryParam`. | FieldDataWrapper | +| `getRowCount()` | Gets the row count of a query results. | N/A | long | +| `getRowRecord(long index)` | Gets a row record from query result. Throws a `ParamException` if the specified index does not exist. | `Index`: index of the row to return. | `QueryResultsWrapper.RowRecord` | +| `getRowRecords()` | Gets a list of row records from the query results | N/A | `List` | + +## FieldDataWrapper + +A tool class to encapsulate field data returned by `query()` API. + +Methods of `FieldDataWrapper`: + +| Method | Description | Returns | +| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `isVectorField()` | Indicated whether this field is a vector field or a scalar field. | Boolean | +| `getDim()` | Gets the dimension value if the field is a vector field. `IllegalResponseException` is thrown if the field is not a vector field. | int | +| `getRowCount()` | Gets the row count of a field. `IllegalResponseException` is thrown if the field data is illegal. | long | +| `getFieldData()` | Returns the field data according to field type. |
  • Returns `List>` for float vector field.
  • Returns `List` for binary vector field.
  • Returns `List` for int64 field.
  • Returns `List` for int32/int16/int8 field.
  • Returns `List` for boolean field.
  • Returns `List` for float field.
  • Returns `List` for double field.
  • Returns `List` for VARCHAR field.
  • | + +## QueryResultsWrapper.RowRecord + +| Method | Description | Returns | +|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------| +| `get(String keyName)` | Get the value of a field by its name. If the field exists either as a pre-defined field or a dynamic field, its value is to return.
    If the field does not exist, a `ParamException` is raised. | Object | + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.QueryResultsWrapper; +import io.milvus.response.FieldDataWrapper; +import io.milvus.grpc.QueryResults; + +QueryParam param = QueryParam.newBuilder() + .withCollectionName("collection1") + .withExpr("id in [100, 101]") + .addOutFields("field1") + .withConsistencyLevel(ConsistencyLevelEnum.EVENTUALLY) + .build(); +R response = client.query(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +QueryResultsWrapper wrapper = new QueryResultsWrapper(response.getData()); +List records = wrapper.getRowRecords(); +for (QueryResultsWrapper.RowRecord record:records) { + System.out.println(record); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/queryAsync().md b/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/queryAsync().md new file mode 100644 index 000000000..c86d4f9f6 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/queryAsync().md @@ -0,0 +1,33 @@ +# queryAsync() + +A MilvusClient interface. This method queries entity(s) asynchronously based on scalar field(s) filtered by boolean expression. + +
    +The order of the returned entities cannot be guaranteed. +
    + +```Java +ListenableFuture> queryAsync(QueryParam requestParam); +``` + +This method uses the same parameter as query(). It invokes RPC interface and returns a `ListenableFuture` object immediately. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.grpc.QueryResults; +import com.google.common.util.concurrent.ListenableFuture; + +QueryParam param = QueryParam.newBuilder() + .withCollectionName("collection1") + .withExpr("id in [100, 101]") + .addOutFields("field1") + .withConsistencyLevel(ConsistencyLevelEnum.EVENTUALLY) + .build(); +ListenableFuture> futureResults = client.queryAsync(param); +R response = futureResults.get(); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/search().md b/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/search().md new file mode 100644 index 000000000..429c7227e --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/search().md @@ -0,0 +1,129 @@ +# search() + +A MilvusClient interface. This method conducts an approximate nearest neighbor (ANN) search on a vector field and pairs up with boolean expression to conduct filtering on scalar fields before searching. + +```Java +R search(SearchParam requestParam); +``` + +## SearchParam + +Use the `SearchParam.Builder` to construct a `SearchParam` object. + +```Java +import io.milvus.param.SearchParam; +SearchParam.Builder builder = SearchParam.newBuilder(); +``` + +Methods of `SearchParam.Builder`: + +| Method | Description | Parameters | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `withCollectionName(collectionName)` | Sets the collection name. The collection name cannot be empty or null. | `collectionName`: The name of the collection to query. | +| `withConsistencyLevel(ConsistencyLevelEnum consistencyLevel)` | Sets the consistency level used in the query. If the consistency level is not specified, the default level is `ConsistencyLevelEnum.BOUNDED`. | `consistencyLevel`: The [consistency level](../Misc/ConsistencyLevelEnum.md) used in the query. | +| `withPartitionNames(List partitionNames)` | Sets a partition name list to specify query scope (Optional). | `partitionNames`: The name list of the partitions to query. | +| `addPartitionName(String partitionName)` | Adds a partition to specify query scope (Optional). | `partitionName`: The name of the partition to query. | +| `withTravelTimestamp(Long ts)` | Specifies an absolute timestamp in a query to get results based on a data view at a specified point in time (Optional). The default value is `0`, with which the server executes the query on a full data view. For more information please refer to [Search with Time Travel](https://milvus.io/docs/v2.1.x/timetravel.md). | `ts`: An absolute timestamp value. | +| `withOutFields(List outFields)` | Specifies the output scalar fields (Optional). If the output fields are specified, the `QueryResults` returned by `query()` will contains the values of these fields. | `outFields`: The name list of output fields. | +| `addOutField(String fieldName)` | Specifies an output scalar field (Optional). | `fieldName`: The name of an output field . | +| `withExpr(String expr)` | Sets the expression to filter scalar fields before searching (Optional). For more information please refer to [Boolean Expression Rules](https://milvus.io/docs/v2.1.x/boolean.md). | `expr`: The expression used to filter scalar fields. | +| `withMetricType(MetricType metricType)` | Sets the metric type of ANN search. The default value is `MetricType.L2`. | `metricType`: The [metric type](../Misc/MetricType.md). | +| `withVectorFieldName(String vectorFieldName)` | Sets the target vector field by name. The field name cannot be empty or null. | `vectorFieldName`: A vector field name. | +| `withTopK(Integer topK)` | Sets the topK value of ANN search. The available range is [1, 16384]. | `topK`: The topK value. | +| `withVectors(List vectors)` | Sets the target vectors. Up to 16384 vectors are allowed. | `vectors`:
  • If target field type is float vector, `List< List>` is required.
  • If target field type is binary vector, `List` is required.
  • | +| `withRoundDecimal(Integer decimal)` | Specifies the decimal place for returned distance. The available range is [-1, 6]. The default value is `-1`, with which the method returns all digits. | `decimal`: The number of digits reserved after the decimal point. | +| `withParams(String params)` | Specifies the search parameters in the JSON format. Valid keys are as follows:
    • Special index-related parameters, such as `nprobe`, `ef`, `search_k`.
    • Metric type with `metric_type` as the key and `L2` or `IP` as the value.
    • The offset for pagination with `offset` as the key and an integer as the value.
    • The limit for pagination with `limit` as the key and an integer as the value.
    | +| `withIgnoreGrowing(Boolean ignoreGrowing)` | Whether to ignore growing segments during similarity searches. The value defaults to `false`, indicating that searches involve growing segments. | `ignoreGrowing`: Whether to ignore growing segments or not. | +| `build()` | Constructs a `SearchParam` object. | N/A | + +The `SearchParam.Builder.build()` can throw the following exceptions: + +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an `R` object. + +- If the API fails on the server side, it returns the error code and message from the server. + +- If the API fails by RPC exception, it returns `R.Status.Unknow` and the error message of the exception. + +- If the API succeeds, it returns valid `SearchResults` held by the R template. You can use `SearchResultsWrapper` to get the results. + +## SearchResultsWrapper + +A tool class to encapsulate the `SearchResults`. + +```Java +import io.milvus.response.SearchResultsWrapper; +SearchResultsWrapper wrapper = new SearchResultsWrapper(searchResults); +``` + +Methods of `SearchResultsWrapper`: + +| Method | Description | Parameters | Returns | +| --------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `getFieldData(String fieldName, int indexOfTarget)` | Gets data for an output field which is specified by `SearchParam`. Throws `ParamException` if the field doesn't exist or `indexOfTarget` is illegal. | `fieldName`: A field name which is specified by the `withOutFields()` of `SearchParam.indexOfTarget` (the order number of a target vector). |
  • Returns `List>` for float vector field.
  • Returns `List` for binary vector field.
  • Returns `List` for int64 field.
  • Returns `List` for int32/int16/int8 field.
  • Returns `List` for boolean field.
  • Returns `List` for float field.
  • Returns `List` for double field.
  • Returns `List` for VARCHAR field.
  • | +| `getIDScore(int indexOfTarget)` | Gets ID-score pairs returned by `search()`. Throws `ParamException` if the `indexOfTarget` is illegal. Throws `IllegalResponseException` if the returned results are illegal. | `indexOfTarget`: Order number of a target vector. | `List` | + +## IDScore + +A tool class to hold a pair of ID and distance. + +Methods of `SearchResultsWrapper.IDScore`: + +| Method |Description | Returns | +| -------------- | -------------------------------------------------- | ----------- | +| `getLongID() ` | Gets the integer ID if the primary key type is Int64. | long | +| `getStrID()` | Gets the string ID if the primary key type is VarChar. | String | +| `getScore()` | Gets the distance value. | float | +| `get(String keyName)` | Get the value of a field by its name. If the field exists either as a pre-defined field or a dynamic field, its value is to return.
    If the field does not exist, a `ParamException` is raised. | Object | + + +Whether `getScore()` is an accurate distance or not depands on the index type: +- FLAT + + The score is **is** accurate distance. + +- IVF_FLAT + + The score **is** accurate distance. + +- IVF_SQ8/IVF_PQ + + The score is **not** accurate. + +- HNSW/ANNOY + + The score **is** accurate. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.SearchResultsWrapper; +import io.milvus.grpc.SearchResults; + +SearchParam param = SearchParam.newBuilder() + .withCollectionName("collection1") + .withMetricType(MetricType.IP) + .withTopK(10) + .withVectors(targetVectors) + .withVectorFieldName("field1") + .withConsistencyLevel(ConsistencyLevelEnum.EVENTUALLY) + .withParams("{\"nprobe\":10,\"offset\":2, \"limit\":3}") + .build(); +R response = client.search(param) +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} + +SearchResultsWrapper wrapper = new SearchResultsWrapper(response.getData().getResults()); +System.out.println("Search results:"); +for (int i = 0; i < targetVectors.size(); ++i) { + List scores = results.getIDScore(i); + for (SearchResultsWrapper.IDScore score:scores) { + System.out.println(score); + } +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/searchAsync().md b/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/searchAsync().md new file mode 100644 index 000000000..a98173154 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/Query and Search/searchAsync().md @@ -0,0 +1,31 @@ +# searchAsync() + +A MilvusClient interface. This method conducts approximate nearest neighbor (ANN) search asynchronously. + +```Java +ListenableFuture> searchAsync(SearchParam requestParam); +``` + +This method uses the same parameter as search(). It invokes the RPC interface and returns a `ListenableFuture` object immediately. + +## Example + +```Java +import io.milvus.param.*; +import io.milvus.response.SearchResultsWrapper; +import io.milvus.grpc.SearchResults; + +SearchParam param = SearchParam.newBuilder() + .withCollectionName("collection1") + .withMetricType(MetricType.IP) + .withTopK(10) + .withVectors(targetVectors) + .withVectorFieldName("field1") + .withConsistencyLevel(ConsistencyLevelEnum.EVENTUALLY) + .build(); +ListenableFuture> futureResults = client.searchAsync(param); +R response = futureResults.get(); +if (response.getStatus() != R.Status.Success.getCode()) { + System.out.println(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/RBAC/addUserToRole().md b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/addUserToRole().md new file mode 100644 index 000000000..2d51176b0 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/addUserToRole().md @@ -0,0 +1,52 @@ +# addUserToRole() + +A MilvusClient interface. This method associates a Milvus user with a Milvus role. + +
    +Note: By being associated with a role, the user has been granted permissions bound to the role. +
    + +```Java +R addUserToRole(AddUserToRoleParam requestParam); +``` + +## AddUserToRoleParam +Use the `AddUserToRoleParam.Builder` to construct an `AddUserToRoleParam` object. + +```Java +import io.milvus.param.AddUserToRoleParam; +AddUserToRoleParam.Builder builder = AddUserToRoleParam.newBuilder(); +``` + +Methods of AddUserToRoleParam.Builder: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withRoleName(String roleName)` | Sets the role name.
    The role name cannot be empty or null. | `roleName`: The role name used to create the privilege. | +| `withUsername(String username)` | Sets the username.
    The username cannot be empty or null. | `username`: The user name. | + +The `AddUserToRoleParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + + +## Returns + +This method catches all the exceptions and returns an `R` object. +- If the API fails on the server side, it returns an error code and an error message. +- If the API fails due to RPC exceptions, it returns `R.Status.Unknown` and error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.AddUserToRoleParam; + +R response = client.addUserToRole(AddUserToRoleParam.newBuilder() + .withRoleName(roleName) + .withUserName(userName) + .build()); + +if (response.getStatus() != R.Status.Success.getCode()) { + throw new RuntimeException(response.getMessage()); +} +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/RBAC/createRole().md b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/createRole().md new file mode 100644 index 000000000..cd993f105 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/createRole().md @@ -0,0 +1,48 @@ +# createRole() + +A MilvusClient interface. This method creates an object to which you can bind some privileges. + +
    +Note: Creates an object to which you can bind some privileges. +
    + +```Java +R createRole(CreateRoleParam requestParam); +``` + +## RequestParam +Use the `CreateRoleParam.Builder` to construct a `CreateRoleParam` object. + +```Java +import io.milvus.param.CreateRoleParam; +CreateRoleParam.Builder builder = CreateRoleParam.newBuilder(); +``` + +Methods of `CreateRoleParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withRoleName(String roleName)` | Sets the role name. The role name cannot be empty or null. | `roleName`: The role name used to create the privilege. | + +The `CreateRoleParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns +This method catches all the exceptions and returns an `R` object. +- If the API fails on the server side, it returns an error code and an error message. +- If the API fails due to RPC exceptions, it returns `R.Status.Unknown` and error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.CreateRoleParam; + +R response = client.createRole(CreateRoleParam.newBuilder() + .withRoleName(roleName) + .build()); + +if (response.getStatus() != R.Status.Success.getCode()) { + throw new RuntimeException(response.getMessage()); +} +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/RBAC/dropRole().md b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/dropRole().md new file mode 100644 index 000000000..5cdbc63d3 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/dropRole().md @@ -0,0 +1,50 @@ +# dropRole() + +A MilvusClient interface. This method drops a role. + +
    +Note: Drops the role from Milvus. It succeeds if the role exists, otherwise fails. +
    + +```Java +R dropRole(DropRoleParam requestParam); +``` + + +## DropRoleParam +Use the `DropRoleParam.Builder` to construct a `DropRoleParam` object. + +```Java +import io.milvus.param.DropRoleParam; +DropRoleParam.Builder builder = DropRoleParam.newBuilder(); +``` + +Methods of `DropRoleParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withRoleName(String roleName)` | Sets the role name. The role name cannot be empty or null. | `roleName`: The role name used to create the privilege. | + +The `DropRoleParam.Builder.build()` can throw the following exceptions: +- `ParamException`: Prompts an error if the parameter is invalid. + + +## Returns +This method catches all the exceptions and returns an R object. +- If the API fails on the server side, it returns an error code and an error message. +- If the API fails due to RPC exceptions, it returns `R.Status.Unknown` and error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.DropRoleParam; + +R response = client.dropRole(DropRoleParam.newBuilder() + .withRoleName(roleName) + .build()); + +if (response.getStatus() != R.Status.Success.getCode()) { + throw new RuntimeException(response.getMessage()); +} +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/RBAC/grantRolePrivilege().md b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/grantRolePrivilege().md new file mode 100644 index 000000000..3ab1724a1 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/grantRolePrivilege().md @@ -0,0 +1,57 @@ +# grantRolePrivilege() + +A MilvusClient interface. This method grants privileges to a role. + +
    +Note: Grants privileges to a role. +
    + +```Java +R grantRolePrivilege(GrantRolePrivilegeParam requestParam); +``` + +## GrantRolePrivilegeParam + +Use the `GrantRolePrivilegeParam.Builder` to construct a `GrantRolePrivilegeParam` object. + +```Java +import io.milvus.param.GrantRolePrivilegeParam; +GrantRolePrivilegeParam.Builder builder = GrantRolePrivilegeParam.newBuilder(); +``` + +Methods of `GrantRolePrivilegeParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withRoleName(String roleName)` | Sets the role name.
    The role name cannot be empty or null. | `roleName`: The role name. | +| `withObject(String object)` | Sets the object.
    The object cannot be empty or null. | `object`: A granted object in Milvus, such as collection, partition, and database. | +| `withObjectName(String objectName)` | Sets the object name.
    The object name cannot be empty or null. | `objectName`: The object name. | +| `withPrivilege(String privilege)` | Sets the privilege.
    The privilege cannot be empty or null. | `privilege`: A concrete permission for accessing some object. | + +For details on applicable objects and privileges, refer to [Users and Roles](https://milvus.io/docs/v2.2.x/users_and_roles.md). + +The `GrantRolePrivilegeParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns +This method catches all the exceptions and returns an R object. +- If the API fails on the server side, it returns an error code and an error message. +- If the API fails due to RPC exceptions, it returns `R.Status.Unknown` and error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.GrantRolePrivilegeParam; + +R response = client.grantRolePrivilege(GrantRolePrivilegeParam.newBuilder() + .withRoleName(roleName) + .withObject(objectType) + .withObjectName(objectName) + .withPrivilege(privilege) + .build()); + +if (response.getStatus() != R.Status.Success.getCode()) { + throw new RuntimeException(response.getMessage()); +} +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/RBAC/removeUserFromRole().md b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/removeUserFromRole().md new file mode 100644 index 000000000..0313a03ad --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/removeUserFromRole().md @@ -0,0 +1,51 @@ +# removeUserFromRole() + +A MilvusClient interface. This method dissociates a Milvus user from a Milvus role. + +
    +Note: The user losses access to the permissions bound to the role. +
    + +```Java +R removeUserFromRole(RemoveUserFromRoleParam requestParam); +``` + +## RemoveUserFromRoleParam + +Use the `RemoveUserFromRoleParam.Builder` to construct a `RemoveUserFromRoleParam` object. + +```Java +import io.milvus.param.RemoveUserFromRoleParam; +RemoveUserFromRoleParam.Builder builder = RemoveUserFromRoleParam.newBuilder(); +``` + +Methods of AddUserToRoleParam.Builder: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withRoleName(String roleName)` | Sets the role name.
    The role name cannot be empty or null. | `roleName`: The role name used to create the privilege. | +| `withUsername(String username)` | Sets the username.
    The username cannot be empty or null. | `username`: The user name. | + +The `RemoveUserFromRoleParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns +This method catches all the exceptions and returns an R object. +- If the API fails on the server side, it returns an error code and an error message. +- If the API fails due to RPC exceptions, it returns `R.Status.Unknown` and error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.AddUserToRoleParam; + +R response = client.removeUserFromRole(AddUserToRoleParam.newBuilder() + .withRoleName(roleName) + .withUserName(userName) + .build()); + +if (response.getStatus() != R.Status.Success.getCode()) { + throw new RuntimeException(response.getMessage()); +} +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/RBAC/revokeRolePrivilege().md b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/revokeRolePrivilege().md new file mode 100644 index 000000000..c3fa3c089 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/revokeRolePrivilege().md @@ -0,0 +1,58 @@ +# revokeRolePrivilege + +A MilvusClient interface. This method revokes the privileges granted to the current role. + +
    +Note: Revokes privileges of a specified role. +
    + +```Java +R revokeRolePrivilege(RevokeRolePrivilegeParam requestParam); +``` + +## RevokeRolePrivilegeParam + +Use the `RevokeRolePrivilegeParam.Builder` to construct a `RevokeRolePrivilegeParam` object. + +```Java +import io.milvus.param.RevokeRolePrivilegeParam; +RevokeRolePrivilegeParam.Builder builder = RevokeRolePrivilegeParam.newBuilder(); +``` + +Methods of `RevokeRolePrivilegeParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withRoleName(String roleName)` | Sets the role name.
    The role name cannot be empty or null. | `roleName`: The role name. | +| `withObject(String object)` | Sets the object.
    The object cannot be empty or null. | `object`: A granted object in Milvus, such as collection, partition, and database. | +| `withObjectName(String objectName)` | Sets the object name. The object name cannot be empty or null. |`objectName`: The object name. | +| `withPrivilege(String privilege)` | Sets the privilege. The privilege cannot be empty or null. | `privilege`: A concrete permission for accessing some object. | + +For details on applicable objects and privileges, refer to [Users and Roles](https://milvus.io/docs/v2.2.x/users_and_roles.md). + +The `RevokeRolePrivilegeParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns + +This method catches all the exceptions and returns an R object. +- If the API fails on the server side, it returns an error code and an error message. +- If the API fails due to RPC exceptions, it returns `R.Status.Unknown` and error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.GrantRolePrivilegeParam; + +R response = client.revokeRolePrivilege(RevokeRolePrivilegeParam.newBuilder() + .withRoleName(roleName) + .withObject(objectType) + .withObjectName(objectName) + .withPrivilege(privilege) + .build()); + +if (response.getStatus() != R.Status.Success.getCode()) { + throw new RuntimeException(response.getMessage()); +} +``` diff --git a/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectGrantForRole().md b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectGrantForRole().md new file mode 100644 index 000000000..ed816b458 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectGrantForRole().md @@ -0,0 +1,47 @@ +# selectGrantForRole() + +A MilvusClient interface. This method lists information about the privileges granted to a role. + +
    +Note: Lists a GrantInfo object for the role. +
    + +```Java +R selectGrantForRole(SelectGrantForRoleParam requestParam); +``` +## SelectGrantForRoleParam +Use the `RevokeRolePrivilegeParam.Builder` to construct a `RevokeRolePrivilegeParam` object. + +```Java +import io.milvus.param.SelectGrantForRoleParam; +SelectGrantForRoleParam.Builder builder = SelectGrantForRoleParam.newBuilder(); +``` + +Methods of `CreateRoleParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withRoleName(String roleName)` | Sets the role name. The role name cannot be empty or null. | `roleName`: The role name used to create the privilege. | + +The `SelectGrantForRoleParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns + +- If the API fails on the server side, it returns an error code and an error message. +- If the API fails due to RPC exceptions, it returns `R.Status.Unknown` and error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.SelectGrantForRoleParam; + +R response = client.selectGrantForRole(SelectGrantForRoleParam.newBuilder() + .withRoleName(roleName) + .build()); + +if (response.getStatus() != R.Status.Success.getCode()) { + throw new RuntimeException(response.getMessage()); +} +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectGrantForRoleAndObject().md b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectGrantForRoleAndObject().md new file mode 100644 index 000000000..a036aa045 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectGrantForRoleAndObject().md @@ -0,0 +1,53 @@ +# selectGrantForRoleAndObject() + +A MilvusClient interface. This method lists privileges and accessible objects of the current role. + +
    +Note: Lists privileges and accessible objects of the current role. +
    + +```Java +R selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam requestParam); +``` + +## SelectGrantForRoleAndObjectParam + +Use the `SelectGrantForRoleAndObjectParam.Builder` to construct a `SelectGrantForRoleAndObjectParam` object. + +```Java +import io.milvus.param.SelectGrantForRoleAndObjectParam; +SelectGrantForRoleAndObjectParam.Builder builder = SelectGrantForRoleAndObjectParam.newBuilder(); +``` + +Methods of `SelectGrantForRoleAndObjectParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withRoleName(String roleName)` | Sets the role name.
    The role name cannot be empty or null. | `roleName`: The role name. | +| `withObject(String object)` | Sets the object.
    The object cannot be empty or null. | `object`: A granted object in Milvus, such as collection, partition, and database. | +| `withObjectName(String objectName)` | Sets the object name.
    The object name cannot be empty or null. | `objectName`: The object name. | + +The `SelectGrantForRoleAndObjectParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns +This method catches all the exceptions and returns an R object. +- If the API fails on the server side, it returns an error code and an error message. +- If the API fails due to RPC exceptions, it returns `R.Status.Unknown` and error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example +```Java +import io.milvus.param.SelectGrantForRoleParam; + +R response = client.selectGrantForRoleAndObject(SelectGrantForRoleAndObjectParam.newBuilder() + .withRoleName(roleName) + .withObject(objectType) + .withObjectName(objectName) + .build()); + +if (response.getStatus() != R.Status.Success.getCode()) { + throw new RuntimeException(response.getMessage()); +} +``` + diff --git a/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectRole().md b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectRole().md new file mode 100644 index 000000000..80c6e627a --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectRole().md @@ -0,0 +1,50 @@ +# selectRole() + +A MilvusClient interface. This method gets all users associated with a role. + +
    +Note: Gets all users associated with the specified role. +
    + +```Java +R selectRole(SelectRoleParam requestParam); +``` + +## SelectRoleParam + +Use the `SelectRoleParam.Builder` to construct a `SelectRoleParam` object. + +```Java +import io.milvus.param.SelectRoleParam; +SelectRoleParam.Builder builder = SelectRoleParam.newBuilder(); +``` + +Methods of SelectRoleParam.Builder: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withRoleName(String roleName)` | Sets the role name.
    The role name cannot be empty or null. | `roleName`: Name of the role to which certain privileges are bound. | +| `withIncludeUserInfo(boolean includeUserInfo)` | Sets the `includeUserInfo`.
    The default value of `includeUserInfo` is false. | `includeUserInfo`: Whether UserInfo is included in the returned results. | + +The `SelectRoleParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns +This method catches all the exceptions and returns an R object. +- If the API fails on the server side, it returns an error code and an error message. +- If the API fails due to RPC exceptions, it returns `R.Status.Unknown` and error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.SelectRoleParam; + +R response = client.selectRole(SelectRoleParam.newBuilder() + .withRoleName(roleName) + .build()); + +if (response.getStatus() != R.Status.Success.getCode()) { + throw new RuntimeException(response.getMessage()); +} +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectUser().md b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectUser().md new file mode 100644 index 000000000..9e1126841 --- /dev/null +++ b/API_Reference/milvus-sdk-java/v2.3.x/RBAC/selectUser().md @@ -0,0 +1,50 @@ +# selectUser() + +A MilvusClient interface. This method gets all roles that a user has. + +
    +Note: Get all roles that a user has. +
    + +```Java +R selectUser(SelectUserParam requestParam); +``` + +## SelectUserParam + +Use the `SelectUserParam.Builder` to construct a `SelectUserParam` object. + +```Java +import io.milvus.param.SelectUserParam; +SelectUserParam.Builder builder = SelectUserParam.newBuilder(); +``` + +Methods of `SelectUserParam.Builder`: + +| Method | Description | Parameters | +| --- | --- | --- | +| `withUsername(String username)` | Sets the username.
    The username cannot be empty or null. | `username`: The user name. | +| `withIncludeRoleInfo(boolean includeRoleInfo)` | Sets the includeRoleInfo.
    The default value of `includeRoleInfo` is False. | `includeRoleInfo`: The include role info or not. | + +The `SelectUserParam.Builder.build()` can throw the following exceptions: +- `ParamException`: error if the parameter is invalid. + +## Returns +This method catches all the exceptions and returns an R object. +- If the API fails on the server side, it returns an error code and an error message. +- If the API fails due to RPC exceptions, it returns `R.Status.Unknown` and error message of the exception. +- If the API succeeds, it returns `R.Status.Success`. + +## Example + +```Java +import io.milvus.param.SelectUserParam; + +R response = client.selectUser(SelectUserParam.newBuilder() + .withUsername(userName) + .build()); + +if (response.getStatus() != R.Status.Success.getCode()) { + throw new RuntimeException(response.getMessage()); +} +``` \ No newline at end of file diff --git a/API_Reference/milvus-sdk-node/v2.3.x/About.md b/API_Reference/milvus-sdk-node/v2.3.x/About.md new file mode 100644 index 000000000..596ce3648 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/About.md @@ -0,0 +1,255 @@ +# About Milvus-sdk-node + +Milvus-sdk-node is a node.js SDK for Milvus, an open-source vector database. Its source code is available on [GitHub](https://github.com/milvus-io/milvus-sdk-node). + +## Compatibility + +The following collection shows Milvus versions and recommended @zilliz/milvus2-sdk-node versions: + +| Milvus version | Node sdk version | Installation | +| :------------: | :--------------: | :---------------------------------- | +| v2.2.0+ | **latest** | `yarn add @zilliz/milvus2-sdk-node` | +| v2.3.0+ | **latest** | `yarn add @zilliz/milvus2-sdk-node` | + +## Dependencies + +- [Milvus](https://milvus.io/) +- [Zilliz Cloud](https://cloud.zilliz.com/signup) +- Node: v14+ + +## 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. + +```javascript +npm install @zilliz/milvus2-sdk-node +# or ... +yarn add @zilliz/milvus2-sdk-node +``` + +This will download the Milvus node.js client and add a dependency entry in your package.json file. + +## Quick Start + +This guide will show you how to set up a simple application using Node.js and Milvus. Its scope is only how to set up the node.js client and perform the simple CRUD operations. For more in-depth coverage, see the [Milvus official website](https://milvus.io/). + +### Create the package.json file + +First, create a directory where your application will live. + +``` +mkdir myProject +cd myProject +``` + +Enter the following command and answer the questions to create the initial structure for your new project: + +```shell +npm init -y +``` + +Next, install this client as a dependency. + +```shell +npm install @zilliz/milvus2-sdk-node +``` + +### Start a milvus server + +```shell +# Download the milvus standalone yaml file +$ wget https://github.com/milvus-io/milvus/releases/download/v2.2.8/milvus-standalone-docker-compose.yml -O docker-compose.yml + +# start the milvus server +sudo docker-compose up -d +``` + +### Connect to Milvus + +Create a new app.js file and add the following code to try out some basic vector operations using the Milvus node.js client. + +```javascript +import { MilvusClient, DataType } from "@zilliz/milvus2-sdk-node"; + +const address = "your-milvus-ip"; +const username = "your-milvus-username"; // optional username +const password = "your-milvus-password"; // optional password +const ssl = false; // secure or not + +// connect to milvus +const client = new MilvusClient({ address, ssl, username, password }); +``` + +| Parameters | Description | Type | Example | +| --------------- | ------------------------------------------------------------------------------------------------------------------------ | ------- | ------------------- | +| address | The Milvus IP address | String | '192.168.0.1:19530' | +| ssl? | SSL connection. It is false by default. | Boolean | false | +| username? | The username used to connect to Milvus | String | milvus | +| address? | The password used to connect to Milvus | String | milvus | +| maxRetries? | The number of retries for the grpc method, by default: 3 | Number | 3 | +| retryDelay? | The delay between attempts at retrying a failed grpc method in ms, by default: 30 | Number | 30 | +| channelOptions? | an optional configuration object that can be passed to a gRPC client when creating a channel to connect to a gRPC server | Number | 30 | + +### define schema for collection + +The code shows an example of how to define a schema for a collection in Milvus using the Milvus Node SDK. A schema defines the properties of a collection, such as the names and data types of the fields that make up the vectors. + +```javascript +// define schema +const collection_name = `book`; +const dim = 128; +const schema = [ + { + name: `book_id`, + description: `customized primary id`, + data_type: DataType.Int64, + is_primary_key: true, + autoID: false, + }, + { + name: `word_count`, + description: `word count`, + data_type: DataType.Int64, + }, + { + name: `book_intro`, + description: `word count`, + data_type: DataType.FloatVector, + dim: dim, + }, +]; +``` + +In the code, the schema variable is defined as an array of objects, where each object represents a field in the collection. The fields are defined using the following properties: + +`name`: The name of the field, which must be unique within the collection. + +`description`: A description of the field, which can be used to provide additional information about the field. + +`data_type`: The data type of the field, which can be one of several predefined data types such as Int64 or FloatVector. + +`is_primary_key`: A boolean flag that indicates whether the field is a primary key. Primary keys are unique identifiers for each vector in the collection, and can be used to efficiently retrieve specific vectors. + +`autoID`: A boolean flag that indicates whether the primary key is automatically generated by Milvus. + +`dim`: The dimensionality of the vector field. For fields of type FloatVector, this specifies the number of dimensions in each vector. + +### create collection + +```javascript +await client.createCollection({ + collection_name, + description: `my first collection`, + fields: schema, +}); +``` + +### prepare data + +When using the Milvus Node SDK to insert data into a collection, it's important to ensure that the data format of the input matches the schema defined for the collection. The data format used by the Milvus Node SDK consists of an array of objects, where each object represents an entity. Typically, each object contains a unique identifier for the entity, which can be an integer or string, and a vector field that stores the feature values as an array of floating-point numbers. + +```javascript +// generate mock data +const fields_data = []; + +// generate mock data +for (let i = 0; i < 1000; i++) { + // create a new object with random values for each field + const r = { + book_id: Math.floor(Math.random() * 100000), // generate a random book ID + word_count: Math.floor(Math.random() * 1000), // generate a random word count + book_intro: [...Array(dim)].map(() => Math.random()), // generate a random vector for book_intro + }; + // add the new object to the fields_data array + fields_data.push(r); +} +``` + +### insert data into collection + +Once we have the data, you can insert data into the collection. + +```javascript +await client.insert({ + collection_name, + fields_data, +}); +``` + +### create index + +By creating an index and loading the collection into memory, you can improve the performance of search and retrieval operations in Milvus, making it faster and more efficient to work with large-scale datasets. + +```javascript +// create index +await client.createIndex({ + collection_name, + field_name: "book_intro", + index_name: "myindex", + index_type: "HNSW", + params: { efConstruction: 10, M: 4 }, + metric_type: "L2", +}); +``` + +Milvus supports [several different types of indexes](https://milvus.io/docs/index.md), each of which is optimized for different use cases and data distributions. Some of the most commonly used index types in Milvus include IVF_FLAT, IVF_SQ8, IVF_PQ, and HNSW. When creating an index in Milvus, you must choose an appropriate index type based on your specific use case and data distribution. + +`collection_name`: The name of the collection to create the index for. + +`field_name`: The name of the field to create the index on. + +`index_name`: The name of the index to create. + +`index_type`: The type of index to create. + +`param`: The index build parameters, please refer to the [index docs](https://milvus.io/docs/index.md). + +`metric_type`: The distance metric to use when computing the similarity between vectors. In this case, the metric type is set to L2, which is a commonly used metric for computing the Euclidean distance between vectors. + +### load collection + +When you create a collection in Milvus, the collection data is initially stored on disk, and it is not immediately available for search and retrieval. In order to search or retrieve data from the collection, you must first load the collection into memory using the loadCollectionSync method. + +```javascript +// load collection +await client.loadCollectionSync({ + collection_name, +}); +``` + +### vector search + +Now you can perform vector search on your collection. + +```javascript +// Generate a random search vector +const searchVector = [...Array(dim)].map(() => Math.random()); + +// Perform a vector search on the collection +const res = await client.search({ + collection_name, // required, the collection name + vector: [0.1, 0.2, 0.3, 0.4], // required, vector used to compare other vectors in milvus + filter: "word_count > 0", // optional, filter + params: { nprobe: 64 }, // optional, specify the search parameters + limit: 1, // specify the number of nearest neighbors to return + metric_type: "L2", // optional, metric to calculate similarity of two vectors + output_fields: ["book_id", "word_count"], // optional, specify the fields to return in the search results +}); +``` + +The code snippet performs a vector search on the collection. + +First, a random search vector is generated. Then, the `client.search()` method is called with several parameters: +`collection_name`: Required. Specifies the name of the Milvus collection to search. + +`vectors`: Required. Specifies the vector used to compare other vectors in Milvus. The example code passes an array of floating-point numbers as the vector. + +`filter` or `expr`: Optional. Specifies a filter to apply to the search query. The example code passes a filter that only includes vectors where the word_count field is greater than 0. + +`params`: Optional. Specifies additional search parameters. The example code sets nprobe to 64, which controls the number of clusters to search during the query. By default, nothing will be set. + +`limit` or `topk`: Optional. Specifies the number of nearest neighbors to return. The example code sets this to 1. By default, it will be `100` + +`metric_type`: Optional. Specifies the metric used to calculate the similarity of two vectors. The example code sets this to `"L2"`. By default, it will be `"L2"`. + +`output_fields`: Optional. Specifies which fields to include in the search results. The example code specifies the `book_id` and `word_count` fields, by default the node sdk will output all fields. diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Client/MilvusClient.md b/API_Reference/milvus-sdk-node/v2.3.x/Client/MilvusClient.md new file mode 100644 index 000000000..9e2211ec3 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Client/MilvusClient.md @@ -0,0 +1,85 @@ +# MilvusClient() + +This class serves as an initializer for a Milvus client instance. Upon successful connection to the Milvus instance, the client can execute various operations. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +const milvusClient = new MilvusClient({ + address: "192.168.0.1:19530", + ssl: false, // deprecated on `node sdk v2.2.12`+ + username: "optional", + password: "optional", +}); +``` + +Now you can use all methods of the client, like `client.createCollection`, `client.createIndex`, `client.loadCollection`, `client.search` to communicate with the Milvus server. + +## Parameters + +| Parameters | Description | Type | Example | +| --------------- | ------------------------------------------------------------------------------------------------------------------------ | ------- | ------------------- | +| address | The Milvus IP address | String | '192.168.0.1:19530' | +| ssl? | SSL connection. It is false by default, if you are using Zilliz Cloud, set it to true. | Boolean | false | +| username? | The username used to connect to Milvus | String | milvus | +| address? | The password used to connect to Milvus | String | milvus | +| maxRetries? | The number of retries for the grpc method, by default: 3 | Number | 3 | +| retryDelay? | The delay between attempts at retrying a failed grpc method in ms, by default: 30 | Number | 30 | +| channelOptions? | an optional configuration object that can be passed to a gRPC client when creating a channel to connect to a gRPC server | Object | | +| tls? | TLS configuration | Object | | + +### TLS config object + +| Parameters | Description | Type | Example | +| --------------- | ------------------------------------------------------------------------------------ | ------- | ------------------------- | +| rootCertPath | The file path to the root certificate used for TLS/SSL connection | String | '/path/to/my/cert' | +| privateKeyPath? | The file path to the private key used for SSL connection | Boolean | '/path/to/my/private_key' | +| certChainPath? | The file path to the certificate chain used for TLS/SSL connection | String | '/path/to/my/cert/chain' | +| verifyOptions? | Options for certificate verification during TLS/SSL connection (e.g., 'verify_peer') | String | | +| serverName? | The server name used for certificate verification during TLS/SSL connection | String | | + +### channelOptions + +```javascript +export interface ChannelOptions { + "grpc.ssl_target_name_override"?: string; + "grpc.primary_user_agent"?: string; + "grpc.secondary_user_agent"?: string; + "grpc.default_authority"?: string; + "grpc.keepalive_time_ms"?: number; + "grpc.keepalive_timeout_ms"?: number; + "grpc.keepalive_permit_without_calls"?: number; + "grpc.service_config"?: string; + "grpc.max_concurrent_streams"?: number; + "grpc.initial_reconnect_backoff_ms"?: number; + "grpc.max_reconnect_backoff_ms"?: number; + "grpc.use_local_subchannel_pool"?: number; + "grpc.max_send_message_length"?: number; + "grpc.max_receive_message_length"?: number; + "grpc.enable_http_proxy"?: number; + /* http_connect_target and http_connect_creds are used for passing data + * around internally, and should not be documented as public-facing options + */ + "grpc.http_connect_target"?: string; + "grpc.http_connect_creds"?: string; + "grpc.default_compression_algorithm"?: CompressionAlgorithms; + "grpc.enable_channelz"?: number; + "grpc.dns_min_time_between_resolutions_ms"?: number; + "grpc.enable_retries"?: number; + "grpc.per_rpc_retry_buffer_size"?: number; + /* This option is pattered like a core option, but the core does not have + * this option. It is closely related to the option + * grpc.per_rpc_retry_buffer_size, which is in the core. The core will likely + * implement this functionality using the ResourceQuota mechanism, so there + * will probably not be any collision or other inconsistency. */ + "grpc.retry_buffer_size"?: number; + "grpc.max_connection_age_ms"?: number; + "grpc.max_connection_age_grace_ms"?: number; + "grpc-node.max_session_memory"?: number; + "grpc.service_config_disable_resolution"?: number; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + [key: string]: any; +} +``` diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Client/checkHealth.md b/API_Reference/milvus-sdk-node/v2.3.x/Client/checkHealth.md new file mode 100644 index 000000000..87358745c --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Client/checkHealth.md @@ -0,0 +1,19 @@ +# checkHealth() + +This method verifies the current status of Milvus to ensure its optimal functioning. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).checkHealth(); +``` + +### Response + +```javascript +{ + isHealth: true, +} +``` diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Client/closeConnection.md b/API_Reference/milvus-sdk-node/v2.3.x/Client/closeConnection.md new file mode 100644 index 000000000..5c6548f1e --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Client/closeConnection.md @@ -0,0 +1,18 @@ +# closeConnection() + +It is recommended to use this method to close the connection to Milvus only when all the required tasks have been completed to avoid any potential data loss or system errors. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).closeConnection(); +``` + +### Response + +```javascript +// grpc client returns closed -> 4, connected -> 0 +4; +``` diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/alterAlias.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/alterAlias.md new file mode 100644 index 000000000..d49183b5a --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/alterAlias.md @@ -0,0 +1,29 @@ +# alterAlias() + +Using this method, you can change the target collection of a pre-existing alias to another collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).alterAlias({ + collection_name: "another_collection", + alias: "my_alias", +}); +``` + +### Response + +```javascript +// create collection returns +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Target collection name | String | +| Alias | Alias name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/createAlias.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/createAlias.md new file mode 100644 index 000000000..cfdc228a2 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/createAlias.md @@ -0,0 +1,29 @@ +# createAlias() + +By creating a collection alias, you can simplify the process of vector search by using the alias instead of the actual collection name. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).createAlias({ + collection_name: "my_collection", + alias: "my_alias", +}); +``` + +### Response + +```javascript +// create collection returns +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Target collection name | String | +| Alias | Alias name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/createCollection.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/createCollection.md new file mode 100644 index 000000000..756073e27 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/createCollection.md @@ -0,0 +1,132 @@ +# createCollection() + +With this method, you can create a new collection with a defined schema based on your specified requirements. + +> The collection to create must contain a primary key field and a vector field. `Int64` or `String` are supported data type on primary key field. + +> The collection to create must contain a vector field, which can be `DataType.FloatVector` or `DataType.BinaryVector`, and set it's dimensions with the property `dim`. + +## Example 1 + +`node sdk v2.2.11+` + +When the collection is created, the SDK will create and load the collection for you, so you can insert data and search directly. + +```javascript +import { MilvusClient, DataType } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).createCollection({ + collection_name: "my_collection", + dimension: 128, +}); +``` + +#### Parameters + +| Parameters | Description | Type | +| ------------------- | -------------------------------------------------------------- | ---------------------------------- | +| collection_name | collection name | String | +| dimension | vector dimension | number | +| primary_field_name? | primary field name | String | +| id_type? | What data type is the id type, default is DataType.Int64, | DataType.Int64 or DataType.VarChar | +| vector_field_name? | vector field name | string | +| metric_type? | max length of the varChar field | string or MetricType | +| enableDynamicField? | enable dynamic field | Bool | +| auto_id? | enable auto id, default is fales | Bool | +| index_params? | create index params, same as parameters for method createIndex | Object | + +## Example 2 + +`node sdk v2.2.0+` + +You need to define schema first, then create the collection. + +```javascript +import { MilvusClient, DataType } from "@zilliz/milvus2-sdk-node"; + +const schema: Field[] = [ + { + name: "age", + description: "id field", + data_type: DataType.Int64, + autoID: true, + is_primary_key: true, + }, + { + name: "vector_01", + description: "vector field", + data_type: DataType.FloatVector, + dim: 8, + }, + { + name: "name", + description: "other field", + data_type: DataType.VarChar, + max_length: 256, + }, + { + name: "meta", + description: "json field", + data_type: DataType.JSON, + }, +]; + +new milvusClient(MILUVS_ADDRESS).createCollection({ + collection_name: "my_collection", + fields: schema, + enable_dynamic_field: false, +}); +``` + +### Response + +```javascript +// create collection returns +{ error_code: 'Success', reason: '' } +``` + +## Parameters + +| Parameters | Description | Type | +| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------- | +| collection_name | Name of the collection to create | String | +| fields | field schema to create | Field[] | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | +| consistency_level? | Consistency in a distributed database specifically refers to the property that ensures every node or replica has the same view of data when writing or reading data at a given time. | String , default: "Bounded" | +| num_partitions? `milvus v2.2.9+` & `node sdk v2.2.12+` | partitions limit, default: 64, max: 4096 | Field[] | +| enable_dynamic_field? `milvus v2.2.9+` & `node sdk v2.2.12+` | enbale dynamic field | String | + +### Field + +| Parameters | Description | Type | +| -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------------------- | +| name | Field name | String | +| data_type | Data type of the field (see the table below) | DataType(number) or String | +| description? | Field description | String | +| autoID? | Boolean value to indicate whether the IDs are automatically generated | Bool | +| dim? | dimension of the vector field | number | +| max_length? | max length of the varChar field | number | +| is_primary_key? | Boolean value to indicate whether this field is used as the primary key | Bool | +| is_partition_key? `milvus v2.2.9+` & `node sdk v2.2.12+` | Boolean value to indicate whether this field is used as the partition key enabled field, only support `Int64` or `VarChar` field | Bool | + +#### The `data_type` property + +You can either use enum or string, for example: `DataType.Int64` or `Int64` for the `data_type` property. + +| Number | String | +| ------ | --------------------------------------- | +| 1 | Bool | +| 2 | Int8 | +| 3 | Int16 | +| 4 | Int32 | +| 5 | Int64 | +| 10 | Float | +| 11 | Double | +| 21 | Varchar | +| 23 | JSON `milvus v2.2.9+` & `node v2.2.12+` | +| 100 | BinaryVector | +| 101 | FloatVector | + +### The `consistency_level` property + +The default value is `"Bounded"`, you can set the consistency level as : `"Session"` or `"Bounded"` or `"Eventually"` or `"Customized"`. diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/describeCollection.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/describeCollection.md new file mode 100644 index 000000000..d1fb11ea3 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/describeCollection.md @@ -0,0 +1,60 @@ +# describeCollection() + +By using this method, you can retrieve a collection's details such as its name, schema, and other relevant information. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).describeCollection({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// describe collection returns +{ + status: { error_code: 'Success', reason: '' }, + schema: { + fields: [ { + type_params: [ + { + dim: 8 + } + ], + index_params: [], + fieldID: '100', + name: 'vector_01', + is_primary_key: false, + description: 'vector field', + data_type: 'FloatVector', + autoID: false + }, + { + type_params: [], + index_params: [], + fieldID: '101', + name: 'age', + is_primary_key: true, + description: '', + data_type: 'Int64', + autoID: true + } ], + name: 'my_collection', + description: '', + autoID: false + }, + collectionID: '434827658485039105', + consistency_level: 'Session', +} +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to check | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/dropAlias.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/dropAlias.md new file mode 100644 index 000000000..83d31d2ed --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/dropAlias.md @@ -0,0 +1,29 @@ +# dropAlias() + +Using this method, you can remove the alias associated with a specific collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).dropAlias({ + collection_name: "my_collection", + alias: "my_alias", +}); +``` + +### Response + +```javascript +// create collection returns +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Target collection name | String | +| Alias | Alias name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/dropCollection.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/dropCollection.md new file mode 100644 index 000000000..a29436841 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/dropCollection.md @@ -0,0 +1,27 @@ +# dropCollection() + +This method drops a collection and all data within this specified collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).dropCollection({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// dropCollection returns +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to drop | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/getCollectionStatistics.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/getCollectionStatistics.md new file mode 100644 index 000000000..663d343fb --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/getCollectionStatistics.md @@ -0,0 +1,31 @@ +# getCollectionStatistics() + +With this method, you can check the number of entities that exist within a specified collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).getCollectionStatistics({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// getCollectionStatistics returns +{ + status: { error_code: 'Success', reason: '' }, + data: { row_count: '0' } + stats: [ { key: 'row_count', value: '0' } ], +} +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to check | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/getLoadState.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/getLoadState.md new file mode 100644 index 000000000..8db4c7f2a --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/getLoadState.md @@ -0,0 +1,36 @@ +# getLoadState() + +Get the loading state of a collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).getLoadState({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// state should be one of LoadState +// enum LoadState { +// LoadStateNotExist = 'LoadStateNotExist', +// LoadStateNotLoad = 'LoadStateNotLoad', +// LoadStateLoading = 'LoadStateLoading', +// LoadStateLoaded = 'LoadStateLoaded', +// } +{ + status: { error_code: 'Success', reason: '' }, + state: 'LoadStateLoaded' +} +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to load | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/getLoadingState.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/getLoadingState.md new file mode 100644 index 000000000..82f48e81e --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/getLoadingState.md @@ -0,0 +1,27 @@ +# getLoadingState() + +Get loading progress of a collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).getLoadingState({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// getLoadingState returns +{status: { error_code: 'Success', reason: '' }, progress: '100'} +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to load | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/getReplicas.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/getReplicas.md new file mode 100644 index 000000000..c21bbb1b3 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/getReplicas.md @@ -0,0 +1,38 @@ +# getReplicas() + +This method returns replica information. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).getReplicas({ + collectionID: 123, +}); +``` + +### Response + +```javascript +// getIndexState returns +{ + replicas: [ + { + partition_ids: [Array], + shard_replicas: [Array], + node_ids: [Array], + replicaID: '436724291187770258', + collectionID: '436777253933154305' + } + ], + status: { error_code: 'Success', reason: '' } +} +``` + +### Parameters + +| Parameters | Description | Type | +| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collectionID | Collection ID | Number | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/hasCollection.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/hasCollection.md new file mode 100644 index 000000000..90fab17b4 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/hasCollection.md @@ -0,0 +1,27 @@ +# hasCollection() + +This method checks if a specified collection exists. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).hasCollection({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// hasCollection returns +{ status: { error_code: 'Success', reason: '' }, value: true } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to check | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/loadCollection.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/loadCollection.md new file mode 100644 index 000000000..fe2496bc0 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/loadCollection.md @@ -0,0 +1,28 @@ +# loadCollection() + +By utilizing this method, you can load a specified collection into memory, which enables you to perform searches or queries on the data contained within it. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).loadCollection({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// loadCollection returns +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | +| collection_name | Name of the collection to load | String | +| replica_number? | number | Collection name | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/loadCollectionSync.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/loadCollectionSync.md new file mode 100644 index 000000000..e1f1bf81a --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/loadCollectionSync.md @@ -0,0 +1,27 @@ +# loadCollectionSync() + +This method allows you to load a specified collection into memory synchronously, ensuring that the collection is successfully loaded and available for search or query operations. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).loadCollectionSync({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// loadCollectionSync returns +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to load. | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/releaseCollection.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/releaseCollection.md new file mode 100644 index 000000000..1fe189ac1 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/releaseCollection.md @@ -0,0 +1,27 @@ +# releaseCollection() + +With this method, you can release a specified collection from memory, freeing up resources and potentially improving system performance. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).releaseCollection({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// releaseCollection returns +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to release | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/renameCollection.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/renameCollection.md new file mode 100644 index 000000000..af3770cb0 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/renameCollection.md @@ -0,0 +1,29 @@ +# renameCollection() + +This method allows you to change the name of a collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).renameCollection({ + collection_name: "my_collection", + new_collection_name: "my_new_collection", +}); +``` + +### Response + +```javascript +// renameCollection returns +{ status: { error_code: 'Success', reason: '' }, value: true } +``` + +### Parameters + +| Parameters | Description | Type | +| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to check | String | +| new_collection_name | New Collection name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Collection/showCollections.md b/API_Reference/milvus-sdk-node/v2.3.x/Collection/showCollections.md new file mode 100644 index 000000000..dfe5a2b30 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Collection/showCollections.md @@ -0,0 +1,45 @@ +# showCollections() + +List all collections or get collection loading status. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).showCollections(); +``` + +### Response + +```javascript +// showCollections returns +{ + status: { error_code: 'Success', reason: '' }, + data: [ + { + name: 'my_collection', + id: '434826867399720961', + timestamp: '1658732862090', + loadedPercentage: undefined + } + ], + created_timestamps: [ '434826867399720964' ], + created_utc_timestamps: [ '1658732862090' ], +} +``` + +### Parameters + +| Parameters | Description | type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | +| collection_name | Name of the collections to check for their loading status | String[] | +| type | ShowCollectionsType | ShowCollectionsType | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | + +#### ShowCollectionsType + +| value | Description | type | +| ----- | ----------- | ------ | +| 0 | All | number | +| 1 | Loaded | number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Data/delete.md b/API_Reference/milvus-sdk-node/v2.3.x/Data/delete.md new file mode 100644 index 000000000..021ebd062 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Data/delete.md @@ -0,0 +1,34 @@ +# delete() + +`node sdk v2.2.12+` + +This method deletes entities by id array. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).delete({ + collection_name: "my_collection", + ids: [1, 2, 3, 4], +}); +``` + +### Response + +```javascript +// query returns +{ + error_code: 'Success', reason: '' +} +``` + +### Parameters + +| Parameters | Description | Type | +| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | +| collection_name | Name of the collection to search on | String | +| ids | id array | String[] or number[] | +| partitions_names? | An array of the names of the partitions to search on. | String[] | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Data/deleteEntities.md b/API_Reference/milvus-sdk-node/v2.3.x/Data/deleteEntities.md new file mode 100644 index 000000000..65a3f9c35 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Data/deleteEntities.md @@ -0,0 +1,39 @@ +# deleteEntities() + +This method deletes entities from a specified collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).deleteEntities({ + collection_name: "my_collection", + expr: "age in [434848878802251176,444848878802251176]", +}); +``` + +### Response + +```javascript +{ + status: { error_code: 'Success', reason: '' }, + succ_index: [], + err_index: [], + acknowledged: false, + insert_cnt: '0', + delete_cnt: '2', + upsert_cnt: '0', + timestamp: '434852827294334977', + IDs: { int_id: { data: [ '434848878802251176', '444848878802251176' ] }, id_field: 'int_id' } +} +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to delete entities from | String | +| expr | Boolean expression used for attibute filtering | String | +| partition_name? | Name of the partition to deleted entities from | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Data/flush.md b/API_Reference/milvus-sdk-node/v2.3.x/Data/flush.md new file mode 100644 index 000000000..0cb5a6b9a --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Data/flush.md @@ -0,0 +1,30 @@ +# flush() + +Milvus uses a cache to hold newly added vectors temporarily. This method is asynchronous and saves the added entities to object storage. After calling this method, you must wait for a period of time for the data to be flushed. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).flush({ + collection_names: ["my_collection"], +}); +``` + +### Response + +```javascript +// flush returns +{ + status: { error_code: 'Success', reason: '' }, + coll_segIDs: { my_collection: { data: [] } } +} +``` + +### Parameters + +| Parameters | Description | Type | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | +| collection_names | An array of the names of collections that contain the data to flush | String[] | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Data/flushSync.md b/API_Reference/milvus-sdk-node/v2.3.x/Data/flushSync.md new file mode 100644 index 000000000..40c7d8d2b --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Data/flushSync.md @@ -0,0 +1,27 @@ +# flushSync() + +This synchronous version of [`flush()` method](API_Reference/milvus-sdk-node/v2.2.x/Data/flush.md). This method differs from others in that it guarantees that the data is flushed and persisted before returning the function result. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).flushSync({ + collection_names: ["my_collection"], +}); +``` + +### Response + +```javascript +// flushSync returns +{ status: { error_code: 'Success', reason: '' }, flushed: true } +``` + +### Parameters + +| Parameters | Description | type | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | +| collection_names | An array of the names of the collections to flush | String[] | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Data/get.md b/API_Reference/milvus-sdk-node/v2.3.x/Data/get.md new file mode 100644 index 000000000..ad7fd1a63 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Data/get.md @@ -0,0 +1,40 @@ +# get() + +`node sdk v2.2.12+` + +This method performs a get vector by id. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).get({ + collection_name: "my_collection", + ids: [1, 2, 3, 4], + output_fields: ["id"], +}); +``` + +### Response + +```javascript +// query returns +{ + status: { error_code: 'Success', reason: '' }, + data: [ + { id: '434848878802248081' }, + ...999 more items, + ] +} +``` + +### Parameters + +| Parameters | Description | Type | +| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | +| collection_name | Name of the collection to search on | String | +| output_fields | Vector or scalar field to be returnsed | String[] | +| ids | id array | String[] or number[] | +| partitions_names? | An array of the names of the partitions to search on. | String[] | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Data/getFlushState.md b/API_Reference/milvus-sdk-node/v2.3.x/Data/getFlushState.md new file mode 100644 index 000000000..9a6c16a07 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Data/getFlushState.md @@ -0,0 +1,27 @@ +# getFlushState() + +This method checks the status of data flushing by segment IDs. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).getFlushState({ + segmentIDs: segIds, +}); +``` + +### Response + +```javascript +// getFlushState returns +{ status: { error_code: 'Success', reason: '' }, flushed: true } +``` + +### Parameters + +| Parameters | Description | type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | +| segmentIDs | An array of the IDs of the segments to check | String[] | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Data/getQuerySegmentInfo.md b/API_Reference/milvus-sdk-node/v2.3.x/Data/getQuerySegmentInfo.md new file mode 100644 index 000000000..329f8efb7 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Data/getQuerySegmentInfo.md @@ -0,0 +1,27 @@ +# getQuerySegmentInfo() + +This method retrieves information about the segments in the query nodes through the proxy. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).getQuerySegmentInfo({ + collectionName: "my_collection", +}); +``` + +### Response + +```javascript +// getQuerySegmentInfo returns +{ status: { error_code: 'Success', reason: '' }, infos: [] } +``` + +### Parameters + +| Parameters | Description | Type | +| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collectionName | Name of the collection to check | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Data/insert.md b/API_Reference/milvus-sdk-node/v2.3.x/Data/insert.md new file mode 100644 index 000000000..0029f53d6 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Data/insert.md @@ -0,0 +1,58 @@ +# insert() + +This method inserts data into a specified collection. + +> If the field type is binary, the vector data length needs to be dimension / 8. + +## Example + +```javascript +const vectorsData = Array.from({ length: 10 }).map(() => ({ + vector_01: Array.from({ length: 4 }).map(() => + Math.floor(Math.random() * 10) + ), +})); + +new milvusClient(MILUVS_ADDRESS).insert({ + collection_name: COLLECTION_NAME, + fields_data: vectorsData, +}); +``` + +### Response + +```javascript +// insert returns +{ + status: { error_code: 'Success', reason: '' }, + succ_index: [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, + ... 990 more items + ], + err_index: [], + acknowledged: false, + insert_cnt: '1', + delete_cnt: '0', + upsert_cnt: '0', + timestamp: '434849944099356674', + IDs: { + int_id: { + data: [ + '434848878802250134', + ...999 more items, + ], + }, + id_field: 'int_id', + }, +} +``` + +### Parameters + +| Parameters | Description | Type | +| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | +| collection_name | Name of the collection to insert data into | String | +| fields_data | Vector data | { [x: string]: any }[] | +| data `node sdk v2.2.12+` | Vector data, fields_data alias | { [x: string]: any }[] | +| partition_name? | Name of the partition to insert data into | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Data/query.md b/API_Reference/milvus-sdk-node/v2.3.x/Data/query.md new file mode 100644 index 000000000..6362706f3 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Data/query.md @@ -0,0 +1,44 @@ +# query() + +This method performs a vector query. + +> You must load the collection before searching or querying + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).query({ + collection_name: "my_collection", + expr: "age > 0", + output_fields: ["age"], + limit: 1000, + offset: 2, +}); +``` + +### Response + +```javascript +// query returns +{ + status: { error_code: 'Success', reason: '' }, + data: [ + { age: '434848878802248081' }, + ...999 more items, + ] +} +``` + +### Parameters + +| Parameters | Description | Type | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- | +| collection_name | Name of the collection to search on | String | +| output_fields | Vector or scalar field to be returnsed | String[] | +| expr or filter | Expression to filter the data | String | +| limit | Sets a value to limit the returned number of entities. It must be a positive integer. The default value is 0, indicating that all entities are returned without a limit. | Number | +| offset | Sets a position, the returned entities before which will be ignored. This parameter works only when the limit value is specified. The default value is 0, starting from beginning of the returned set of entities. | Number | +| partitions_names? | An array of the names of the partitions to search on. | String[] | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Data/search.md b/API_Reference/milvus-sdk-node/v2.3.x/Data/search.md new file mode 100644 index 000000000..be7ada9ae --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Data/search.md @@ -0,0 +1,92 @@ +# search() + +This method performs a vector similarity search. + +> You must load the collection before searching or querying. + +## Example + +```javascript +import { MilvusClient, DataType, MetricType } from "@zilliz/milvus2-sdk-node"; + +// simple search example +new milvusClient(MILUVS_ADDRESS).search({ + collection_name: "my_collection", + vector: [1, 2, 3, 4], +}); + +// complex search example +new milvusClient(MILUVS_ADDRESS).search({ + collection_name: "my_collection", + vector: [1, 2, 3, 4], + filter: "count > 5", + limit: 10, + offset: 2, + metric_type: MetricType.L2, + param: { nprobe: 1024 }, + consistency_level: ConsistencyLevelEnum.Strong, +}); + +// batch search example +new milvusClient(MILUVS_ADDRESS).search({ + collection_name: "my_collection", + vectors: [ + [1, 2, 3, 4], + [5, 6, 7, 8], + ], +}); +``` + +### Response + +#### Single search response + +```javascript +{ + status: { error_code: 'Success', reason: '' }, + results: [ + { score: 22, age: '434848878802251176' }, + { score: 22, age: '434848878802251181' }, + { score: 23, age: '434848878802251173' }, + { score: 25, age: '434848878802251179' } + ] +} +``` + +#### Batch search response + +```javascript +{ + status: { error_code: 'Success', reason: '' }, + results: [ + [ + { score: 22, age: '434848878802251176' }, + { score: 22, age: '434848878802251181' }, + { score: 23, age: '434848878802251173' }, + { score: 25, age: '434848878802251179' } + ], + [ + { score: 22, age: '434848878802251176' }, + { score: 22, age: '434848878802251181' }, + { score: 23, age: '434848878802251173' }, + { score: 25, age: '434848878802251179' } + ], + ] +} +``` + +#### Parameters + +| Parameters | Description | Type | +| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------- | +| collection_name | Name of the collection to search on | String | +| vector? or vectors? | vector or vectors to search | Number[] or Number[][] | +| limit? or topk? | Topk, by default: 10 | Number | +| offset? | offset, by default: 0 | Number | +| output_fields? | Vector or scalar field to be returnsed, by default, we will output all fields in the collection | String[] | +| partitions_names? | An array of the names of the partitions to search on | String[] | +| metric_type? | similarity metric, by default, it is 'L2' | String | +| filter? or expr? | Boolean expression to filter the data | String | +| params? | Optional search param, it depends on vector index, for example {nprobe: 1024} ,Please refer to https://milvus.io/docs/index.md. | Object | +| consistency_level? | Consistency in a distributed database specifically refers to the property that ensures every node or replica has the same view of data when writing or reading data at a given time. | Enum | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Database/createDatabase().md b/API_Reference/milvus-sdk-node/v2.3.x/Database/createDatabase().md new file mode 100644 index 000000000..22f6fba77 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Database/createDatabase().md @@ -0,0 +1,40 @@ +# createDatabase() + +`milvus v2.2.9+` & `node sdk v2.2.12+` + +This method creates a database. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +await milvusClient.createDatabase({ + db_name: DB_NAME, +}); +``` + +### Response + +```javascript +{ + db_names: [ + 'default', + 'BinarySearch', + 'Replica', + 'Data', + 'Collection', + 'PartitionKey', + 'Insert', + 'database_yppgoyeo' + ], + status: { error_code: 'Success', reason: '' } +} +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| db_name | Database name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Database/dropDatabase().md b/API_Reference/milvus-sdk-node/v2.3.x/Database/dropDatabase().md new file mode 100644 index 000000000..fc62efa4f --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Database/dropDatabase().md @@ -0,0 +1,30 @@ +# dropDatabase() + +`milvus v2.2.9+` & `node sdk v2.2.12+` + +This method drops a databases. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +await milvusClient.dropDatabase({ + db_name: DB_NAME, +}); +``` + +### Response + +```javascript +{ + status: { error_code: 'Success', reason: '' }, +} +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| db_name | Database name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Database/listDatabases().md b/API_Reference/milvus-sdk-node/v2.3.x/Database/listDatabases().md new file mode 100644 index 000000000..77e0ca956 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Database/listDatabases().md @@ -0,0 +1,27 @@ +# listDatabases() + +`milvus v2.2.9+` & `node sdk v2.2.12+` + +This method lists all databases. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +await milvusClient.listDatabases(); +``` + +### Response + +```javascript +{ + status: { error_code: 'Success', reason: '' }, +} +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Database/use().md b/API_Reference/milvus-sdk-node/v2.3.x/Database/use().md new file mode 100644 index 000000000..5bb01b79f --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Database/use().md @@ -0,0 +1,43 @@ +# use() + +`milvus v2.2.9+` & `node v2.2.12+` + +This method changes the default database. + +A Milvus cluster ships with a default database named `default`. All collection operations are performed within the default database. You can use this method to change the default database. + +## Example + +````javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +// create a db +await milvusClient.createDatabase({ + db_name: DB_NAME, +}); + +// use that db +await milvusClient.use({ + db_name: DB_NAME, +}); + +// create collection on that database +await milvusClient.createCollection({ + ... +}); +``` + +### Response + +```javascript +{ + status: { error_code: 'Success', reason: '' }, +} +```` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| db_name | Database name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Index/createIndex.md b/API_Reference/milvus-sdk-node/v2.3.x/Index/createIndex.md new file mode 100644 index 000000000..aa0b79090 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Index/createIndex.md @@ -0,0 +1,38 @@ +# createIndex() + +This method generates an index on a vector field. It is important to note that the index creation process is asynchronous. + +## Example + +```javascript +import { MilvusClient, MetricType, IndexType } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).createIndex({ + collection_name: "my_collection", + field_name: "vector_01", + index_name: "index_name", + index_type: IndexType.IVF_FLAT, + metric_type: MetricType.L2, + params: { nlist: 10 }, +}); +``` + +### Response + +```javascript +// createIndex returns +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | +| collection_name | Collection name | String | +| field_name | Name of the field to create index on | String | +| index_name? | Name of the index to create | String | +| extra_params? | Extra index parameters (see the table below) | IndexParams | +| index_type | Index type | String | +| metric_type | Metric type | String | +| params | Index parameters | Object | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Index/describeIndex.md b/API_Reference/milvus-sdk-node/v2.3.x/Index/describeIndex.md new file mode 100644 index 000000000..4ca6a5a5b --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Index/describeIndex.md @@ -0,0 +1,43 @@ +# describeIndex() + +This method fetches the index details from a collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).describeIndex({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// describeIndex returns +{ + status: { error_code: 'Success', reason: '' }, + index_descriptions: [ + { + params: [ + { key: 'index_type', value: 'IVF_FLAT' }, + { key: 'metric_type', value: 'IP' }, + { key: 'params', value: '{"nlist":10}' } + ], + index_name: '_default_idx', + indexID: '434828928027721731', + field_name: 'vector_01' + } + ], +} +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to check | String | +| field_name? | Name of the field to check | String | +| index_name? | Name of the index to check | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Index/dropIndex.md b/API_Reference/milvus-sdk-node/v2.3.x/Index/dropIndex.md new file mode 100644 index 000000000..ed3f198cb --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Index/dropIndex.md @@ -0,0 +1,28 @@ +# dropIndex() + +This method drops the specified index. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).dropIndex({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// dropIndex returns +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Collection name | String | +| field_name | Field name | String | +| index_name? | Index name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Index/getIndexBuildProgress.md b/API_Reference/milvus-sdk-node/v2.3.x/Index/getIndexBuildProgress.md new file mode 100644 index 000000000..0b18bb214 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Index/getIndexBuildProgress.md @@ -0,0 +1,35 @@ +# getIndexBuildProgress() + +This method monitors the index building progress and displays the total number of rows as well as the number of indexed rows. + +> This method has been deprecated since version 2.2.0, you can use getIndexState instead. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).getIndexBuildProgress({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// getIndexBuildProgress returns +{ + status: { error_code: 'Success', reason: '' }, + indexed_rows: '0', + total_rows: '0' +} +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Collection name | String | +| field_name? | Name of the field to build index on | String | +| index_name? | Name of the index to check | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Index/getIndexState.md b/API_Reference/milvus-sdk-node/v2.3.x/Index/getIndexState.md new file mode 100644 index 000000000..cb1f1841b --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Index/getIndexState.md @@ -0,0 +1,33 @@ +# getIndexState() + +This method monitors the index building progress and displays the total number of rows as well as the number of indexed rows. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).getIndexState({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +// getIndexState returns +{ + status: { error_code: 'Success', reason: '' }, + state: 'Finished', + fail_reason: '' +} +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Collection name | String | +| field_name? | Name of the field to build index on | String | +| index_name? | Name of the index to check | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Partition/createPartition.md b/API_Reference/milvus-sdk-node/v2.3.x/Partition/createPartition.md new file mode 100644 index 000000000..8a5deb318 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Partition/createPartition.md @@ -0,0 +1,28 @@ +# createPartition() + +This method creates a partition in a specified collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).createPartition({ + collection_name: "my_collection", + partition_name: "my_partition", +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to create a partition in | String | +| partition_name | Name of the partition to create | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Partition/dropPartition.md b/API_Reference/milvus-sdk-node/v2.3.x/Partition/dropPartition.md new file mode 100644 index 000000000..fe0230686 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Partition/dropPartition.md @@ -0,0 +1,30 @@ +# dropPartition() + +This method is used to drop a partition and all the data contained within it. + +> the `_default` partition cannot be dropped. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).dropPartition({ + collection_name: "my_collection", + partition_name: "my_partition", +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection in which to drop the partition | String | +| partition_name | Name of the partition to drop | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Partition/getPartitionStatistics.md b/API_Reference/milvus-sdk-node/v2.3.x/Partition/getPartitionStatistics.md new file mode 100644 index 000000000..9039248ca --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Partition/getPartitionStatistics.md @@ -0,0 +1,32 @@ +# getPartitionStatistics() + +This method retrieves statistics about a specified partition. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).getPartitionStatistics({ + collection_name: "my_collection", + partition_name: "my_partition", +}); +``` + +### Response + +```javascript +{ + status: { error_code: 'Success', reason: '' }, + data: { row_count: '0' }, + stats: [ { key: 'row_count', value: '0' } ] +} +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection in which the partition to check exists | String | +| partition_name | Name of the partition to check | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Partition/hasPartition.md b/API_Reference/milvus-sdk-node/v2.3.x/Partition/hasPartition.md new file mode 100644 index 000000000..56c20a711 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Partition/hasPartition.md @@ -0,0 +1,28 @@ +# hasPartition() + +This method verifies if a partition exists in the specified collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).hasPartition({ + collection_name: "my_collection", + partition_name: "my_partition", +}); +``` + +### Response + +```javascript +{ status: { error_code: 'Success', reason: '' }, value: true } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection in which the partition to verify exists | String | +| partition_name | Name of the partition to verify | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Partition/loadPartitions.md b/API_Reference/milvus-sdk-node/v2.3.x/Partition/loadPartitions.md new file mode 100644 index 000000000..10080097c --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Partition/loadPartitions.md @@ -0,0 +1,30 @@ +# loadPartitions() + +This method is used to load a specific partition into memory for search or query purposes. + +> You must load before searching or querying + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).loadPartitions({ + collection_name: "my_collection", + partition_names: ["my_partition"], +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | +| collection_name | Name of the collection in which the partition to load exists | String | +| partition_names | An array of the names of the partitions to load | String[] | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Partition/releasePartitions.md b/API_Reference/milvus-sdk-node/v2.3.x/Partition/releasePartitions.md new file mode 100644 index 000000000..0d8bcdb1a --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Partition/releasePartitions.md @@ -0,0 +1,28 @@ +# releasePartitions() + +This method is used to release a specific partition from memory. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).releasePartitions({ + collection_name: "my_collection", + partition_names: ["my_partition"], +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | +| collection_name | Name of the collection in which the partition to release exists | String | +| partition_names | An array of the name of the partitions to release | String[] | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Partition/showPartitions.md b/API_Reference/milvus-sdk-node/v2.3.x/Partition/showPartitions.md new file mode 100644 index 000000000..67d7e65ef --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Partition/showPartitions.md @@ -0,0 +1,33 @@ +# showPartitions() + +This method lists all the partitions in a specified collection. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).showPartitions({ + collection_name: "my_collection", +}); +``` + +### Response + +```javascript +{ + status: { error_code: 'Success', reason: '' }, + partition_names: [ '_default', 'my_partition' ], + partitionIDs: [ '434827144696954882', '434827353243779073' ], + created_timestamps: [ '434827144696954883', '434827353243779075' ], + created_utc_timestamps: [ '1658733919895', '1658734715438' ], + inMemory_percentages: [] +} +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| collection_name | Name of the collection to list all the partitions within | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/addUserToRole.md b/API_Reference/milvus-sdk-node/v2.3.x/User/addUserToRole.md new file mode 100644 index 000000000..d4dfd2403 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/addUserToRole.md @@ -0,0 +1,30 @@ +# addUserToRole() + +This method adds a user to a specified role in Milvus. + +# Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).addUserToRole({ + username: "my-username", + roleName: "my-milvus-role-name", +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| username | The user name | String | +| roleName | The role name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | + +# diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/createRole.md b/API_Reference/milvus-sdk-node/v2.3.x/User/createRole.md new file mode 100644 index 000000000..cca9d3c3f --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/createRole.md @@ -0,0 +1,26 @@ +# createRole() + +This method creates a new role in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).createRole({ + roleName: "my-milvus-role", +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| roleName | The role name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/createUser.md b/API_Reference/milvus-sdk-node/v2.3.x/User/createUser.md new file mode 100644 index 000000000..60a01d38b --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/createUser.md @@ -0,0 +1,28 @@ +# createUser() + +This is a method for creating a user identity in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).createUser({ + username: "milvus", + password: "milvus", +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| username | The username used to log into Milvus | String | +| password | The password used to log into Milvus. | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/deleteUser.md b/API_Reference/milvus-sdk-node/v2.3.x/User/deleteUser.md new file mode 100644 index 000000000..f86cb1e9f --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/deleteUser.md @@ -0,0 +1,26 @@ +# deleteUser() + +This method deletes a user identity in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).deleteUser({ + username: "milvus", +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| username | The existing username in Milvus to delete | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/dropAllRoles.md b/API_Reference/milvus-sdk-node/v2.3.x/User/dropAllRoles.md new file mode 100644 index 000000000..e06abf277 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/dropAllRoles.md @@ -0,0 +1,23 @@ +# dropAllRoles() + +This method iterates through all roles, revokes any granted privileges, and drops all roles. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).dropAllRoles(); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/dropRole.md b/API_Reference/milvus-sdk-node/v2.3.x/User/dropRole.md new file mode 100644 index 000000000..56c1bf38a --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/dropRole.md @@ -0,0 +1,26 @@ +# dropRole() + +This method drops a user role in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).dropRole({ + roleName: "my-milvus-role", +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| roleName | The role name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/grantRolePrivilege.md b/API_Reference/milvus-sdk-node/v2.3.x/User/grantRolePrivilege.md new file mode 100644 index 000000000..7a29fb9fa --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/grantRolePrivilege.md @@ -0,0 +1,28 @@ +# grantRolePrivilege() + +This method grants privileges to a role. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILVUS_ADDRESS).grantRolePrivilege({ + roleName: "roleName", + object: "*", + objectName: "Collection", + privilegeName: "CreateIndex", +}); +``` + +### Response + +### Parameters + +| Parameters | Description | Type | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| roleName | The user role name | String | +| object | Type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive. | boolean | +| objectName | Name of the object to which the role is granted the specified prvilege. | string | +| privilegeName | Name of the privilege to be granted to the role. This parameter is case-sensitive. | string | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/hasRole.md b/API_Reference/milvus-sdk-node/v2.3.x/User/hasRole.md new file mode 100644 index 000000000..f6e55973c --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/hasRole.md @@ -0,0 +1,22 @@ +# hasRole() + +This method verifies if the role already exists. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).hasRole({ + roleName: "my-role", +}); +``` + +### Response + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| roleName | The role name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/listGrant.md b/API_Reference/milvus-sdk-node/v2.3.x/User/listGrant.md new file mode 100644 index 000000000..308483974 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/listGrant.md @@ -0,0 +1,20 @@ +# listGrants() + +This method lists all granted privileges in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).listGrants(); +``` + +### Response + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| roleName | The role name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/listRoles.md b/API_Reference/milvus-sdk-node/v2.3.x/User/listRoles.md new file mode 100644 index 000000000..5cf65cd6b --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/listRoles.md @@ -0,0 +1,19 @@ +# listRoles() + +This method lists all roles in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).listRoles(); +``` + +### Response + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/listUsers.md b/API_Reference/milvus-sdk-node/v2.3.x/User/listUsers.md new file mode 100644 index 000000000..768bae119 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/listUsers.md @@ -0,0 +1,26 @@ +# listUsers() + +This method lists all users in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).listUsers(); +``` + +### Response + +```javascript +{ + status: { error_code: 'Success', reason: '' }, + usernames: [ 'root','milvus' ], +} +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/removeUserFromRole.md b/API_Reference/milvus-sdk-node/v2.3.x/User/removeUserFromRole.md new file mode 100644 index 000000000..dde0fe1d2 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/removeUserFromRole.md @@ -0,0 +1,28 @@ +# removeUserFromRole() + +This method remove a user from role in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).removeUserFromRole({ + username: "my-username", + roleName: "my-milvus-role-name", +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| username | The user name | String | +| roleName | The role name | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/revokeRolePrivilege.md b/API_Reference/milvus-sdk-node/v2.3.x/User/revokeRolePrivilege.md new file mode 100644 index 000000000..dc48562ab --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/revokeRolePrivilege.md @@ -0,0 +1,28 @@ +# revokeRolePrivilege() + +This method revokes the privileges granted to a role. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILVUS_ADDRESS).revokeRolePrivilege({ + roleName: "roleName", + object: "*", + objectName: "Collection", + privilegeName: "CreateIndex", +}); +``` + +### Response + +### Parameters + +| Parameters | Description | Type | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| roleName | The user role name | String | +| object | Type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive. | boolean | +| objectName | Name of the object to which the role is granted the specified prvilege. | string | +| privilegeName | Name of the privilege to be granted to the role. This parameter is case-sensitive. | string | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/selectGrant.md b/API_Reference/milvus-sdk-node/v2.3.x/User/selectGrant.md new file mode 100644 index 000000000..9244e1839 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/selectGrant.md @@ -0,0 +1,28 @@ +# selectGrant() + +This method retrieves the list of privileges granted to a role in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILVUS_ADDRESS).selectGrant({ + roleName: "roleName", + object: "*", + objectName: "Collection", + privilegeName: "CreateIndex", +}); +``` + +### Response + +### Parameters + +| Parameters | Description | Type | +| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| roleName | The user role name | String | +| object | Type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive. | boolean | +| objectName | Name of the object to which the role is granted the specified prvilege. | string | +| privilegeName | Name of the privilege to be granted to the role. This parameter is case-sensitive. | string | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/selectRole.md b/API_Reference/milvus-sdk-node/v2.3.x/User/selectRole.md new file mode 100644 index 000000000..9ae5b8ae6 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/selectRole.md @@ -0,0 +1,24 @@ +# selectRole() + +This method recieve a role information from milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).selectRole({ + username: "my-username", + includeUserInfo: true, +}); +``` + +### Response + +### Parameters + +| Parameters | Description | Type | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| roleName | The role name | String | +| includeUserInfo? | should result including user info, by default: true | boolean | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/selectUser.md b/API_Reference/milvus-sdk-node/v2.3.x/User/selectUser.md new file mode 100644 index 000000000..12ffb08e0 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/selectUser.md @@ -0,0 +1,24 @@ +# selectUser() + +This method retrieves a list of all roles assigned to a specified user in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).selectUser({ + username: "my-username", + includeUserInfo: true, +}); +``` + +### Response + +### Parameters + +| Parameters | Description | Type | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| userName | The user name | String | +| includeUserInfo? | should result including user info, by default: true | boolean | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/User/updateUser.md b/API_Reference/milvus-sdk-node/v2.3.x/User/updateUser.md new file mode 100644 index 000000000..406373125 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/User/updateUser.md @@ -0,0 +1,30 @@ +# updateUser() + +This method update user info in Milvus. + +## Example + +```javascript +import { MilvusClient } from "@zilliz/milvus2-sdk-node"; + +new milvusClient(MILUVS_ADDRESS).createUser({ + username: "milvus", + oldPassword: "oldMilvusPass", + newPassword: "newMilvusPass", +}); +``` + +### Response + +```javascript +{ error_code: 'Success', reason: '' } +``` + +### Parameters + +| Parameters | Description | Type | +| ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| username | The username used to log into Milvus | String | +| newPassword | The new password used to log into Milvus. | String | +| oldPassword | The old password used to log into Milvus. | String | +| timeout? | This parameter is used to specify the length of time, in milliseconds, that the RPC (Remote Procedure Call) is allowed to run. If no value is provided, the default is undefined. | Number | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Utils/datetimeToHybrids.md b/API_Reference/milvus-sdk-node/v2.3.x/Utils/datetimeToHybrids.md new file mode 100644 index 000000000..b86cdf91c --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Utils/datetimeToHybrids.md @@ -0,0 +1,24 @@ +# datetimeToHybrids() + +This method generates a hybrid timestamp based on an existing datetime. + +## Example + +```javascript +import { datetimeToHybrids } from "@zilliz/milvus2-sdk-node"; + +datetimeToHybrids(new Date(1638957092 * 1000)); +``` + +### Response + +```javascript +//The hybrid timestamp +429642767925248000; +``` + +### Parameters + +| Parameters | Description | Type | +| --------------- | ------------------------------------------------------------------------------------ | ------ | +| HybridTimestamp | The hybrid timestamp, a non-negative integer ranging from 0 to 18446744073709551615. | String | diff --git a/API_Reference/milvus-sdk-node/v2.3.x/Utils/hybridtsToUnixtime.md b/API_Reference/milvus-sdk-node/v2.3.x/Utils/hybridtsToUnixtime.md new file mode 100644 index 000000000..8f9b77e72 --- /dev/null +++ b/API_Reference/milvus-sdk-node/v2.3.x/Utils/hybridtsToUnixtime.md @@ -0,0 +1,24 @@ +# hybridtsToUnixtime() + +This method converts a hybrid timestamp to UNIX Epoch time despite the timing logic. + +## Invocation + +```javascript +import { hybridtsToUnixtime } from "@zilliz/milvus2-sdk-node"; + +hybridtsToUnixtime("429642767925248000"); +``` + +### Response + +```javascript +// The UNIX Epoch time +1638957092; +``` + +### Parameters + +| Parameters | Description | Type | +| ---------- | -------------------------------------------------------------------------------------------------- | ------ | +| unixTime | Unix Epoch time, the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT). | String | diff --git a/API_Reference/pymilvus/v2.3.x/About.md b/API_Reference/pymilvus/v2.3.x/About.md index fb74a0cba..1dab28b54 100644 --- a/API_Reference/pymilvus/v2.3.x/About.md +++ b/API_Reference/pymilvus/v2.3.x/About.md @@ -11,7 +11,7 @@ PyMilvus is a Python SDK of Milvus. Its source code is open-sourced and hosted o | 2.0.x | 2.0.2 | | 2.1.x | 2.1.3 | | 2.2.x | 2.2.3 | -| 2.3.0-beta | 2.3.0b1 +| 2.3.0 | 2.3.0 ## Installation @@ -24,7 +24,7 @@ $ pip3 install pymilvus - Install a specific version of PyMilvus. ```shell -$ pip3 install pymilvus==2.3.0b1 +$ pip3 install pymilvus==2.3.0 ``` - Upgrade PyMilvus to the latest version.