From 83788a3785d3df0968aad8f0553e69c63173a1d1 Mon Sep 17 00:00:00 2001 From: Lutkin Wang Date: Tue, 10 Mar 2020 00:31:47 +0800 Subject: [PATCH] Update README.md --- core/src/server/web_impl/README.md | 1110 ++++++++++++++-------------- 1 file changed, 572 insertions(+), 538 deletions(-) diff --git a/core/src/server/web_impl/README.md b/core/src/server/web_impl/README.md index dc0db1ab..6100894d 100644 --- a/core/src/server/web_impl/README.md +++ b/core/src/server/web_impl/README.md @@ -4,38 +4,38 @@ - [Overview](#overview) - [API Reference](#api-reference) - - [`/state`](#state) - - [`/devices`](#devices) - - [`/config/advanced` (GET)](#configadvanced-get) - - [`/config/advanced` (PUT)](#configadvanced-put) - - [`/config/advanced` (OPTIONS)](#configadvanced-options) - - [`/config/gpu_resources` (GET)](#configgpu_resources-get) - - [`/config/gpu_resources` (PUT)](#configgpu_resources-put) - - [`/config/gpu_resources` (OPTIONS)](#configgpu_resources-options) - - [`/collections` (GET)](#collections-get) - - [`/collections` (POST)](#collections-post) - - [`/collections` (OPTIONS)](#collections-options) - - [`/collections/{collection_name}` (GET)](#collectionscollection_name-get) - - [`/collections/{collection_name}` (DELETE)](#collectionscollection_name-delete) - - [`/collections/{collection_name}` (OPTIONS)](#collectionscollection_name-options) - - [`/collections/{collection_name}/indexes` (GET)](#collectionscollection_nameindexes-get) - - [`/collections/{collection_name}/indexes` (POST)](#collectionscollection_nameindexes-post) - - [`/collections/{collection_name}/indexes` (DELETE)](#collectionscollection_nameindexes-delete) - - [`/collections/{collection_name}/indexes` (OPTIONS)](#collectionscollection_nameindexes-options) - - [`/collections/{collection_name}/partitions` (GET)](#collectionscollection_namepartitions-get) - - [`/collections/{collection_name}/partitions` (POST)](#collectionscollection_namepartitions-post) - - [`/collections/{collection_name}/partitions` (OPTIONS)](#collectionscollection_namepartitions-options) - - [`/collections/{collection_name}/partitions` (DELETE)](#collectionscollection_namepartitions-delete) - - [`/collections/{collection_name}/segments` (GET)](#collectionscollection_namesegments-get) - - [`/collections/{collection_name}/segments/{segment_name}/vectors` (GET)](#collectionscollection_namesegmentssegment_namevectors-get) - - [`/collections/{collection_name}/segments/{segment_name}/ids` (GET)](#collectionscollection_namesegmentssegment_nameids-get) - - [`/collections/{collection_name}/vectors` (PUT)](#collectionscollection_namevectors-put) - - [`/collections/{collection_name}/vectors` (POST)](#collectionscollection_namevectors-post) - - [`/collections/{collection_name}/vectors` (GET)](#collectionscollection_namevectorsidvector_id-get) - - [`/collections/{collection_name}/vectors` (OPTIONS)](#collectionscollection_namevectors-options) - - [`/system/{msg}` (GET)](#systemmsg-get) - - [`system/{op}` (PUT)](#systemop-put) -- [Error Codes](#error-codes) + - [`/state`](#state) + - [`/devices`](#devices) + - [`/config/advanced` (GET)](#configadvanced-get) + - [`/config/advanced` (PUT)](#configadvanced-put) + - [`/config/advanced` (OPTIONS)](#configadvanced-options) + - [`/config/gpu_resources` (GET)](#configgpu_resources-get) + - [`/config/gpu_resources` (PUT)](#configgpu_resources-put) + - [`/config/gpu_resources` (OPTIONS)](#configgpu_resources-options) + - [`/collections` (GET)](#collections-get) + - [`/collections` (POST)](#collections-post) + - [`/collections` (OPTIONS)](#collections-options) + - [`/collections/{collection_name}` (GET)](#collectionscollection_name-get) + - [`/collections/{collection_name}` (DELETE)](#collectionscollection_name-delete) + - [`/collections/{collection_name}` (OPTIONS)](#collectionscollection_name-options) + - [`/collections/{collection_name}/indexes` (GET)](#collectionscollection_nameindexes-get) + - [`/collections/{collection_name}/indexes` (POST)](#collectionscollection_nameindexes-post) + - [`/collections/{collection_name}/indexes` (DELETE)](#collectionscollection_nameindexes-delete) + - [`/collections/{collection_name}/indexes` (OPTIONS)](#collectionscollection_nameindexes-options) + - [`/collections/{collection_name}/partitions` (GET)](#collectionscollection_namepartitions-get) + - [`/collections/{collection_name}/partitions` (POST)](#collectionscollection_namepartitions-post) + - [`/collections/{collection_name}/partitions` (OPTIONS)](#collectionscollection_namepartitions-options) + - [`/collections/{collection_name}/partitions` (DELETE)](#collectionscollection_namepartitions-delete) + - [`/collections/{collection_name}/segments` (GET)](#collectionscollection_namesegments-get) + - [`/collections/{collection_name}/segments/{segment_name}/vectors` (GET)](#collectionscollection_namesegmentssegment_namevectors-get) + - [`/collections/{collection_name}/segments/{segment_name}/ids` (GET)](#collectionscollection_namesegmentssegment_nameids-get) + - [`/collections/{collection_name}/vectors` (PUT)](#collectionscollection_namevectors-put) + - [`/collections/{collection_name}/vectors` (POST)](#collectionscollection_namevectors-post) + - [`/collections/{collection_name}/vectors` (GET)](#collectionscollection_namevectorsidvector_id-get) + - [`/collections/{collection_name}/vectors` (OPTIONS)](#collectionscollection_namevectors-options) + - [`/system/{msg}` (GET)](#systemmsg-get) + - [`system/{op}` (PUT)](#systemop-put) +- [Error Codes](#error-codes) @@ -51,18 +51,18 @@ Checks whether the web server is running. #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/state` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | -------------------------- | +| Name | `/state` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| +| Status code | Description | +| ----------- | -------------------------- | +| 200 | The request is successful. | #### Example @@ -75,7 +75,7 @@ $ curl -X GET "http://127.0.0.1:19121/state" -H "accept: application/json" ##### Response ```json -{"message":"Success","code":0} +{ "message": "Success", "code": 0 } ``` ### `/devices` @@ -84,20 +84,19 @@ Gets CPU/GPU information from the host. #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/devices` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | -------------------------- | +| Name | `/devices` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | - +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | #### Example @@ -110,7 +109,7 @@ $ curl -X GET "http://127.0.0.1:19121/devices" -H "accept: application/json" ##### Response ```json -{"cpu":{"memory":31},"gpus":{"GPU0":{"memory":5}}} +{ "cpu": { "memory": 31 }, "gpus": { "GPU0": { "memory": 5 } } } ``` ### `/config/advanced` (GET) @@ -119,19 +118,19 @@ Gets the values of parameters in `cache_config` and `engine_config` of the Milvu #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/config/advanced` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | -------------------------- | +| Name | `/config/advanced` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | #### Example @@ -144,7 +143,12 @@ $ curl -X GET "http://127.0.0.1:19121/config/advanced" -H "accept: application/j ##### Response ```json -{"cpu_cache_capacity":4,"cache_insert_data":false,"use_blas_threshold":1100,"gpu_search_threshold":1000} +{ + "cpu_cache_capacity": 4, + "cache_insert_data": false, + "use_blas_threshold": 1100, + "gpu_search_threshold": 1000 +} ``` ### `/config/advanced` (PUT) @@ -173,19 +177,19 @@ Updates the values of parameters in `cache_config` and `engine_config` of the Mi ##### Body Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `cpu_cache_capacity` | Value of `cpu_cache_capacity` in the Milvus configuration file. The default is 4.| No | -| `cache_insert_data` | Value of `cache_insert_data` in the Milvus configuration file. The default is false. | No | -| `use_blas_threshold` | Value of `use_blas_threshold` in the Milvus configuration file. The default is 1100. | No | -| `gpu_search_threshold` | Value of `gpu_search_threshold` in the Milvus configuration file. The default is 1000. | No | +| Parameter | Description | Required? | +| ---------------------- | -------------------------------------------------------------------------------------- | --------- | +| `cpu_cache_capacity` | Value of `cpu_cache_capacity` in the Milvus configuration file. The default is 4. | No | +| `cache_insert_data` | Value of `cache_insert_data` in the Milvus configuration file. The default is false. | No | +| `use_blas_threshold` | Value of `use_blas_threshold` in the Milvus configuration file. The default is 1100. | No | +| `gpu_search_threshold` | Value of `gpu_search_threshold` in the Milvus configuration file. The default is 1000. | No | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | #### Example @@ -197,9 +201,8 @@ $ curl -X PUT "http://127.0.0.1:19121/config/advanced" -H "accept: application/j ##### Response - ```json -{"message": "OK","code": 0} +{ "message": "OK", "code": 0 } ``` ### `/config/advanced` (OPTIONS) @@ -208,13 +211,12 @@ Use this API for Cross-Origin Resource Sharing (CORS). #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/config/advanced` | -| Header | N/A | -| Body | N/A | -| Method | OPTIONS | - +| Request Component | Value | +| ----------------- | ------------------ | +| Name | `/config/advanced` | +| Header | N/A | +| Body | N/A | +| Method | OPTIONS | #### Example @@ -232,19 +234,19 @@ Gets the parameter values in `gpu_resource_config` of the Milvus configuration f #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/config/gpu_resources` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | -------------------------- | +| Name | `/config/gpu_resources` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | #### Example @@ -256,9 +258,13 @@ $ curl -X GET "http://127.0.0.1:19121/config/gpu_resources" -H "accept: applicat ##### Response - ```json -{"enable":true,"cache_capacity":1,"search_resources":["GPU0"],"build_index_resources":["GPU0"]} +{ + "enable": true, + "cache_capacity": 1, + "search_resources": ["GPU0"], + "build_index_resources": ["GPU0"] +} ``` ### `/config/gpu_resources` (PUT) @@ -287,19 +293,19 @@ Updates the parameter values in `gpu_resource_config` of the Milvus configuratio ##### Body Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `enable` | Specifies whether to enable GPU resources. | Yes | -| `cache_capacity` | Size of GPU memory per card used for cache in GBs. | Yes | -| `search_resources` | GPU devices used for search computation, must be in format `gpux`. | Yes | -| `build_index_resources` | GPU devices used for index building, must be in format `gpux`. | Yes | +| Parameter | Description | Required? | +| ----------------------- | ------------------------------------------------------------------ | --------- | +| `enable` | Specifies whether to enable GPU resources. | Yes | +| `cache_capacity` | Size of GPU memory per card used for cache in GBs. | Yes | +| `search_resources` | GPU devices used for search computation, must be in format `gpux`. | Yes | +| `build_index_resources` | GPU devices used for index building, must be in format `gpux`. | Yes | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | #### Example @@ -312,7 +318,7 @@ $ curl -X PUT "http://127.0.0.1:19121/config/gpu_resources" -H "accept: applicat ##### Response ```json -{"message": "OK","code": 0} +{ "message": "OK", "code": 0 } ``` ### `/config/gpu_resources` (OPTIONS) @@ -323,12 +329,12 @@ Use this API for Cross-Origin Resource Sharing (CORS). #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/config/gpu_resources` | -| Header | N/A | -| Body | N/A | -| Method | OPTIONS | +| Request Component | Value | +| ----------------- | ----------------------- | +| Name | `/config/gpu_resources` | +| Header | N/A | +| Body | N/A | +| Method | OPTIONS | #### Example @@ -344,27 +350,26 @@ Gets all collections starting from `offset` and ends with `page_size`. #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/collections` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | -------------------------- | +| Name | `/collections` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `offset` | Row offset from which the data page starts. The default is 0. | No | -| `page_size` | Size of the data page. The default is 10. | No | - +| Parameter | Description | Required? | +| ----------- | ------------------------------------------------------------- | --------- | +| `offset` | Row offset from which the data page starts. The default is 0. | No | +| `page_size` | Size of the data page. The default is 10. | No | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | #### Example @@ -376,9 +381,21 @@ $ curl -X GET "http://127.0.0.1:19121/collections?offset=0&page_size=1" -H "acce ##### Response - ```json -{"collections":[{"collection_name":"test_collection","dimension":1,"index_file_size":10,"metric_type":"L2","count":0,"index":"FLAT","nlist":16384}],"count":58} +{ + "collections": [ + { + "collection_name": "test_collection", + "dimension": 1, + "index_file_size": 10, + "metric_type": "L2", + "count": 0, + "index": "FLAT", + "nlist": 16384 + } + ], + "count": 58 +} ``` ### `/collections` (POST) @@ -405,19 +422,19 @@ Creates a collection. ##### Body Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | The name of the collection to create, which must be unique within its database. | Yes | -| `dimension` | The dimension of the vectors that are to be inserted into the created collection. | Yes | -| `index_file_size` | Threshold value that triggers index building for raw data files. The default is 1024. | No | -| `metric_type` | The method vector distances are compared in Milvus. The default is L2. Currently supported metrics include `L2` (Euclidean distance), `IP` (Inner Product), `HAMMING` (Hamming distance), `JACCARD` (Jaccard distance), and `TANIMOTO` (Tanomoto distance). | No | +| Parameter | Description | Required? | +| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | +| `collection_name` | The name of the collection to create, which must be unique within its database. | Yes | +| `dimension` | The dimension of the vectors that are to be inserted into the created collection. | Yes | +| `index_file_size` | Threshold value that triggers index building for raw data files. The default is 1024. | No | +| `metric_type` | The method vector distances are compared in Milvus. The default is L2. Currently supported metrics include `L2` (Euclidean distance), `IP` (Inner Product), `HAMMING` (Hamming distance), `JACCARD` (Jaccard distance), and `TANIMOTO` (Tanomoto distance). | No | #### Response -| Status code | Description | -|-----------------|---| -| 201 | Created | -| 400 | The request is incorrect. Refer to the error message for details. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 201 | Created | +| 400 | The request is incorrect. Refer to the error message for details. | #### Example @@ -429,9 +446,8 @@ $ curl -X POST "http://127.0.0.1:19121/collections" -H "accept: application/json ##### Response - ```json -{"message":"OK","code":0} +{ "message": "OK", "code": 0 } ``` ### `/collections` (OPTIONS) @@ -440,13 +456,12 @@ Use this API for Cross-Origin Resource Sharing (CORS). #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/collections` | -| Header | N/A | -| Body | N/A | -| Method | OPTIONS | - +| Request Component | Value | +| ----------------- | -------------- | +| Name | `/collections` | +| Header | N/A | +| Body | N/A | +| Method | OPTIONS | #### Example @@ -462,29 +477,27 @@ Gets all information about a collection by name. #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/collections/{collection_name}` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | - +| Request Component | Value | +| ----------------- | -------------------------------- | +| Name | `/collections/{collection_name}` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | -| `info` | Type of information to acquire. `info` must either be empty or `stat`. When `info` is empty, Milvus returns collection name, dimension, index file size, metric type, offset, index type, and nlist of the collection. When `info` is `stat`, Milvus returns the collection offset, partition status, and segment status. | No | - +| Parameter | Description | Required? | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | +| `info` | Type of information to acquire. `info` must either be empty or `stat`. When `info` is empty, Milvus returns collection name, dimension, index file size, metric type, offset, index type, and nlist of the collection. When `info` is `stat`, Milvus returns the collection offset, partition status, and segment status. | No | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -497,7 +510,15 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection" -H "accept: a ##### Response ```json -{"collection_name":"test_collection","dimension":1,"index_file_size":10,"metric_type":"L2","count":0,"index":"FLAT", "index_params":{}} +{ + "collection_name": "test_collection", + "dimension": 1, + "index_file_size": 10, + "metric_type": "L2", + "count": 0, + "index": "FLAT", + "index_params": {} +} ``` ##### Request @@ -510,51 +531,55 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection?info=stat" -H ```json { - "count":150000, - "partitions_stat":[ - { - "count":1000,"partition_tag":"_default", - "segments_stat":[ - {"count":1000,"index":"IVFFLAT","segment_name":"1583727170217439000","size":5284922} - ] - } - ] + "count": 150000, + "partitions_stat": [ + { + "count": 1000, + "partition_tag": "_default", + "segments_stat": [ + { + "count": 1000, + "index": "IVFFLAT", + "segment_name": "1583727170217439000", + "size": 5284922 + } + ] + } + ] } ``` - ### `/collections/{collection_name}` (DELETE) Drops a collection by name. #### Request -| Request Component | Value | -|-----------------|-----| -| Name | `/collections/{collection_name}` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | DELETE | +| Request Component | Value | +| ----------------- | -------------------------------- | +| Name | `/collections/{collection_name}` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | DELETE | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | #### Response -| Status code | Description | -|-----------------|---| -| 204 | Deleted| -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 204 | Deleted | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example ##### Request - ```shell $ curl -X DELETE "http://127.0.0.1:19121/collections/test_collection" -H "accept: application/json" ``` @@ -567,19 +592,18 @@ Use this API for Cross-Origin Resource Sharing (CORS). #### Request -| Request Component | Value | -|-----------------|-----| -| Name | `/collections/{collection_name}` | -| Header | N/A | -| Body | N/A | -| Method | OPTIONS | +| Request Component | Value | +| ----------------- | -------------------------------- | +| Name | `/collections/{collection_name}` | +| Header | N/A | +| Body | N/A | +| Method | OPTIONS | #### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | - +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | #### Example @@ -595,26 +619,26 @@ Gets the index type and nlist of a collection. #### Request -| Request Component | Value | -|-----------------|-----| -| Name | `/collections/{collection_name}/indexes` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | ---------------------------------------- | +| Name | `/collections/{collection_name}/indexes` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -626,9 +650,8 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection/indexes" -H "a ##### Response - ```json -{"index_type":"FLAT","params":{"nlist":4096}} +{ "index_type": "FLAT", "params": { "nlist": 4096 } } ``` ### `/collections/{collection_name}/indexes` (POST) @@ -655,24 +678,24 @@ Updates the index type and nlist of a collection. ##### Body Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `index_type` | The type of indexing method to query the collection. Please refer to [Index Types](https://www.milvus.io/docs/reference/index.md) for detailed introduction of supported indexes. The default is "FLAT". | No | -| `params` | The extra params of indexing method to query the collection. Please refer to - [Index params](#index_param) for detailed introduction of supported indexes. | No | +| Parameter | Description | Required? | +| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | +| `index_type` | The type of indexing method to query the collection. Please refer to [Index Types](https://www.milvus.io/docs/reference/index.md) for detailed introduction of supported indexes. The default is "FLAT". | No | +| `params` | The extra params of indexing method to query the collection. Please refer to - [Index params](#index_param) for detailed introduction of supported indexes. | No | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | #### Response -| Status code | Description | -|-----------------|---| -| 201 | Created | -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 201 | Created | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -685,7 +708,7 @@ $ curl -X POST "http://127.0.0.1:19121/collections/test_collection/indexes" -H " ##### Response ```json -{"message":"OK","code":0} +{ "message": "OK", "code": 0 } ``` ### `/collections/{collection_name}/indexes` (DELETE) @@ -694,27 +717,26 @@ Drops an index for a collection. #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/collections/{collection_name}/indexes` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | DELETE | +| Request Component | Value | +| ----------------- | ---------------------------------------- | +| Name | `/collections/{collection_name}/indexes` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | DELETE | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | #### Response -| Status code | Description | -|-----------------|---| -| 204 | Deleted | -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | Resource not available | - +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 204 | Deleted | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | Resource not available | #### Example @@ -726,25 +748,24 @@ $ curl -X DELETE "http://127.0.0.1:19121/collections/test_collection/indexes" -H If the deletion is successful, no message will be returned. - ### `/collections/{collection_name}/indexes` (OPTIONS) Use this API for Cross-Origin Resource Sharing (CORS). #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/collections/{collection_name}/indexes` | -| Header | N/A | -| Body | N/A | -| Method | OPTIONS | +| Request Component | Value | +| ----------------- | ---------------------------------------- | +| Name | `/collections/{collection_name}/indexes` | +| Header | N/A | +| Body | N/A | +| Method | OPTIONS | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | #### Example @@ -760,28 +781,28 @@ Gets all partitions in a collection starting from `offset` and ends with `page_s #### Request -| Request Component | Value | -|-----------------|-----------| -| Name | `/collections/{collection_name}/partitions` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | ------------------------------------------- | +| Name | `/collections/{collection_name}/partitions` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | -| `offset` | Row offset from which the data page starts. The default is 0. | No | -| `page_size` | Size of the data page. The default is 10. | No | +| Parameter | Description | Required? | +| ----------------- | ------------------------------------------------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | +| `offset` | Row offset from which the data page starts. The default is 0. | No | +| `page_size` | Size of the data page. The default is 10. | No | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -794,7 +815,14 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection/partitions?off ##### Response ```json -{"partitions":[{"partition_tag": "_default"},{"partition_tag":"test_tag"},{"partition_tag":"test_2"}], "count":10} +{ + "partitions": [ + { "partition_tag": "_default" }, + { "partition_tag": "test_tag" }, + { "partition_tag": "test_2" } + ], + "count": 10 +} ``` ### `/collections/{collection_name}/partitions` (POST) @@ -803,20 +831,20 @@ Creates a partition in a collection. #### Request -| Request Component | Value | -|-----------------|-----------| -| Name | `/collections/{collection_name}/partitions` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | POST | +| Request Component | Value | +| ----------------- | ------------------------------------------- | +| Name | `/collections/{collection_name}/partitions` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | POST | #### Response -| Status code | Description | -|-----------------|---| -| 201 | Created | -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 201 | Created | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -829,7 +857,7 @@ $ curl -X POST "http://127.0.0.1:19121/collections/test_collection/partitions" - ##### Response ```json -{"message":"OK","code":0} +{ "message": "OK", "code": 0 } ``` ### `/collections/{collection_name}/partitions` (OPTIONS) @@ -838,19 +866,18 @@ Use this API for Cross-Origin Resource Sharing (CORS). #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/collections/{collection_name}/partitions` | -| Header | N/A | -| Body | N/A | -| Method | OPTIONS | +| Request Component | Value | +| ----------------- | ------------------------------------------- | +| Name | `/collections/{collection_name}/partitions` | +| Header | N/A | +| Body | N/A | +| Method | OPTIONS | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | - +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | #### Example @@ -881,18 +908,18 @@ Deletes a partition by tag. ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection that contains the partition. | Yes | -| `partition_tag` | Tag of the partition to delete. | yes | +| Parameter | Description | Required? | +| ----------------- | --------------------------------------------------- | --------- | +| `collection_name` | Name of the collection that contains the partition. | Yes | +| `partition_tag` | Tag of the partition to delete. | yes | #### Response -| Status code | Description | -|-----------------|---| -| 204 | Deleted | -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The requested resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 204 | Deleted | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The requested resource does not exist. | #### Example @@ -904,35 +931,34 @@ $ curl -X DELETE "http://127.0.0.1:19121/collections/test_collection/partitions The deletion is successful if no information is returned. - ### `/collections/{collection_name}/segments` (GET) Gets all segments in a collection starting from `offset` and ends with `page_size`. #### Request -| Request Component | Value | -|-----------------|-----------| -| Name | `/collections/{collection_name}/segments` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | ----------------------------------------- | +| Name | `/collections/{collection_name}/segments` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | -| `offset` | Row offset from which the data page starts. The default is 0. | No | -| `page_size` | Size of the data page. The default is 10. | No | +| Parameter | Description | Required? | +| ----------------- | ------------------------------------------------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | +| `offset` | Row offset from which the data page starts. The default is 0. | No | +| `page_size` | Size of the data page. The default is 10. | No | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -946,18 +972,18 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection/segments?offse ```json { - "code":0, - "message":"OK", - "count":2, - "segments":[ - { - "count":10000, - "index":"IVFFLAT", - "partition_tag":"_default", - "segment_name":"1583727470444700000", - "size":5284922 - } - ] + "code": 0, + "message": "OK", + "count": 2, + "segments": [ + { + "count": 10000, + "index": "IVFFLAT", + "partition_tag": "_default", + "segment_name": "1583727470444700000", + "size": 5284922 + } + ] } ``` @@ -967,29 +993,29 @@ Gets all vectors of segment in a collection starting from `offset` and ends with #### Request -| Request Component | Value | -|-----------------|-----------| -| Name | `/collections/{collection_name}/segments` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | ----------------------------------------- | +| Name | `/collections/{collection_name}/segments` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | -| `segment_name` | Name of the segment. | Yes | -| `offset` | Row offset from which the data page starts. The default is 0. | No | -| `page_size` | Size of the data page. The default is 10. | No | +| Parameter | Description | Required? | +| ----------------- | ------------------------------------------------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | +| `segment_name` | Name of the segment. | Yes | +| `offset` | Row offset from which the data page starts. The default is 0. | No | +| `page_size` | Size of the data page. The default is 10. | No | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -1003,15 +1029,15 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection/segments/15837 ```json { - "code":0, - "message":"OK", - "count":2, - "vectors": [ - { - "vector": [0.1], - "id": "1583727470435045000" - } - ] + "code": 0, + "message": "OK", + "count": 2, + "vectors": [ + { + "vector": [0.1], + "id": "1583727470435045000" + } + ] } ``` @@ -1021,29 +1047,29 @@ Gets all vector ids of segment in a collection starting from `offset` and ends w #### Request -| Request Component | Value | -|-----------------|-----------| -| Name | `/collections/{collection_name}/segments` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | ----------------------------------------- | +| Name | `/collections/{collection_name}/segments` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | -| `segment_name` | Name of the segment. | Yes | -| `offset` | Row offset from which the data page starts. The default is 0. | No | -| `page_size` | Size of the data page. The default is 10. | No | +| Parameter | Description | Required? | +| ----------------- | ------------------------------------------------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | +| `segment_name` | Name of the segment. | Yes | +| `offset` | Row offset from which the data page starts. The default is 0. | No | +| `page_size` | Size of the data page. The default is 10. | No | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -1057,12 +1083,11 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection/segments/15837 ```json { - "ids": ["1583727470435045000"], - "count": 10000 + "ids": ["1583727470435045000"], + "count": 10000 } ``` - ### `/collections/{collection_name}/vectors` (PUT) 1. Searches vectors in a collection. @@ -1091,30 +1116,29 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection/segments/15837 ##### Body Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `topk` | The top k most similar results of each query vector. | Yes | -| `tags` | Tags of partitions that you need to search. You do not have to specify this value if the collection is not partitioned or you wish to search the whole collection. | No | -| `file_ids` | IDs of the vector files. You do not have to specify this value if you do not use Milvus in distributed scenarios. Also, if you assign a value to `file_ids`, the value of `tags` is ignored. | No | -| `vectors` | Vectors to query. | Yes | -| `params` | Extra params for search. Please refer to [Search param](#index_param) to get more detail information. | Yes | +| Parameter | Description | Required? | +| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | +| `topk` | The top k most similar results of each query vector. | Yes | +| `tags` | Tags of partitions that you need to search. You do not have to specify this value if the collection is not partitioned or you wish to search the whole collection. | No | +| `file_ids` | IDs of the vector files. You do not have to specify this value if you do not use Milvus in distributed scenarios. Also, if you assign a value to `file_ids`, the value of `tags` is ignored. | No | +| `vectors` | Vectors to query. | Yes | +| `params` | Extra params for search. Please refer to [Search param](#index_param) to get more detail information. | Yes | > Note: Type of items of vectors depends on the metric used by the collection. If the collection uses `L2` or `IP`, you must use `float`. If the collection uses `HAMMING`, `JACCARD`, or `TANIMOTO`, you must use `uint8`. - ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -1127,7 +1151,15 @@ $ curl -X PUT "http://127.0.0.1:19121/collections/test_collection/vectors" -H "a ##### Response ```json -{"num":1,"results":[[{"id":"1578989029645098000","distance":"0.000000"},{"id":"1578989029645098001","distance":"0.010000"}]]} +{ + "num": 1, + "results": [ + [ + { "id": "1578989029645098000", "distance": "0.000000" }, + { "id": "1578989029645098001", "distance": "0.010000" } + ] + ] +} ``` 2. Delete vectors @@ -1150,24 +1182,23 @@ $ curl -X PUT "http://127.0.0.1:19121/collections/test_collection/vectors" -H "a ##### Body Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| ids | IDs of vectors. | Yes | - +| Parameter | Description | Required? | +| --------- | --------------- | --------- | +| ids | IDs of vectors. | Yes | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -1180,7 +1211,7 @@ $ curl -X PUT "http://127.0.0.1:19121/collections/test_collection/vectors" -H "a ##### Response ```json -{"code": 0, "message": "success"} +{ "code": 0, "message": "success" } ``` ### `/collections/{collection_name}/vectors` (POST) @@ -1207,27 +1238,27 @@ Inserts vectors to a collection. ##### Body Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `partition_tag` | Tag of the partition to insert vectors to. | No | -| `vectors` | Vectors to insert to the collection. | Yes | -| `ids` | IDs of the vectors to insert to the collection. If you assign IDs to the vectors, you must provide IDs for all vectors in the collection. If you do not specify this parameter, Milvus automatically assigns IDs to the vectors. | No | +| Parameter | Description | Required? | +| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- | +| `partition_tag` | Tag of the partition to insert vectors to. | No | +| `vectors` | Vectors to insert to the collection. | Yes | +| `ids` | IDs of the vectors to insert to the collection. If you assign IDs to the vectors, you must provide IDs for all vectors in the collection. If you do not specify this parameter, Milvus automatically assigns IDs to the vectors. | No | > Note: Type of items of `vectors` depends on the metric used by the collection. If the collection uses `L2` or `IP`, you must use `float`. If the collection uses `HAMMING`, `JACCARD`, or `TANIMOTO`, you must use `uint8`. ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | #### Response -| Status code | Description | -|-----------------|---| -| 201 | Created | -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 201 | Created | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -1240,7 +1271,14 @@ $ curl -X POST "http://127.0.0.1:19121/collections/test_collection/vectors" -H " ##### Response ```json -{"ids":["1578989029645098000","1578989029645098001","1578989029645098002","1578989029645098003"]} +{ + "ids": [ + "1578989029645098000", + "1578989029645098001", + "1578989029645098002", + "1578989029645098003" + ] +} ``` ### `/collections/{collection_name}/vectors?id={vector_id}` (GET) @@ -1249,28 +1287,27 @@ Obtain a vector to by ID. #### Request -| Request Component | Value | -|-----------------|-----------| -| Name | `/collections/{collection_name}/vectors` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | ---------------------------------------- | +| Name | `/collections/{collection_name}/vectors` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | #### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `collection_name` | Name of the collection. | Yes | -| `vector_id` | Vector id. | Yes | - +| Parameter | Description | Required? | +| ----------------- | ----------------------- | --------- | +| `collection_name` | Name of the collection. | Yes | +| `vector_id` | Vector id. | Yes | #### Response -| Status code | Description | -|-----------------|---| -| 201 | Created | -| 400 | The request is incorrect. Refer to the error message for details. | -| 404 | The required resource does not exist. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 201 | Created | +| 400 | The request is incorrect. Refer to the error message for details. | +| 404 | The required resource does not exist. | #### Example @@ -1284,28 +1321,27 @@ $ curl -X POST "http://127.0.0.1:19121/collections/test_collection/vectors?id=15 ```json { - "vectors": [ - { - "id": "1578989029645098000", - "vector": [0.1] - } - ] + "vectors": [ + { + "id": "1578989029645098000", + "vector": [0.1] + } + ] } ``` - ### `/collections/{collection_name}/vectors` (OPTIONS) Use this API for Cross-Origin Resource Sharing (CORS). #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/collections/{collection_name}/vectors` | -| Header | N/A | -| Body | N/A | -| Method | OPTIONS | +| Request Component | Value | +| ----------------- | ---------------------------------------- | +| Name | `/collections/{collection_name}/vectors` | +| Header | N/A | +| Body | N/A | +| Method | OPTIONS | #### Example @@ -1321,25 +1357,25 @@ Gets information about the Milvus server. #### Request -| Request Component | Value | -|-----------------|---| -| Name | `/system/{msg}` | -| Header | `accept: application/json` | -| Body | N/A | -| Method | GET | +| Request Component | Value | +| ----------------- | -------------------------- | +| Name | `/system/{msg}` | +| Header | `accept: application/json` | +| Body | N/A | +| Method | GET | ##### Query Parameters -| Parameter | Description | Required? | -|-----------------|---|------| -| `msg` | Type of the message to return. You can use `status` or `version`. | Yes | +| Parameter | Description | Required? | +| --------- | ----------------------------------------------------------------- | --------- | +| `msg` | Type of the message to return. You can use `status` or `version`. | Yes | #### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | #### Example @@ -1352,14 +1388,14 @@ $ curl -X GET "http://127.0.0.1:19121/system/version" -H "accept: application/js ##### Response ```json -{"reply":"0.7.0"} +{ "reply": "0.7.0" } ``` ### `system/{op}` (PUT) -1. Flush collections +#### Flush a collection -#### Request +##### Request @@ -1375,30 +1411,30 @@ $ curl -X GET "http://127.0.0.1:19121/system/version" -H "accept: application/js
Request ComponentValue
MethodPUT
-#### Response +##### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | -#### Example +##### Example -##### Request +###### Request ```shell $ curl -X PUT "http://127.0.0.1:19121/system/task" -H "accept: application/json" -d "{\"flush\": {\"collection_names\": [\"test_collection\"]}}" ``` -##### Response +###### Response ```json -{"code": 0, "message": "success"} +{ "code": 0, "message": "success" } ``` -2. Compact collection +#### Compact segments in a collection -#### Request +##### Request @@ -1414,30 +1450,30 @@ $ curl -X PUT "http://127.0.0.1:19121/system/task" -H "accept: application/json"
Request ComponentValue
MethodPUT
-#### Response +##### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | -#### Example +##### Example -##### Request +###### Request ```shell $ curl -X PUT "http://127.0.0.1:19121/system/task" -H "accept: application/json" -d "{\"compact\": {\"collection_name\": \"test_collection\"}}" ``` -##### Response +###### Response ```json -{"code": 0, "message": "success"} +{ "code": 0, "message": "success" } ``` -3. Load collection to memory +#### Load a collection to memory -#### Request +##### Request @@ -1453,30 +1489,30 @@ $ curl -X PUT "http://127.0.0.1:19121/system/task" -H "accept: application/json"
Request ComponentValue
MethodPUT
-#### Response +##### Response -| Status code | Description | -|-----------------|---| -| 200 | The request is successful.| -| 400 | The request is incorrect. Refer to the error message for details. | +| Status code | Description | +| ----------- | ----------------------------------------------------------------- | +| 200 | The request is successful. | +| 400 | The request is incorrect. Refer to the error message for details. | -#### Example +##### Example -##### Request +###### Request ```shell $ curl -X PUT "http://127.0.0.1:19121/system/task" -H "accept: application/json" -d "{\"load\": {\"collection_name\": \"test_collection\"}}" ``` -##### Response +###### Response ```json -{"code": 0, "message": "success"} +{ "code": 0, "message": "success" } ``` -## Index param +## Index parameters -For each index type, it has specific index param and searach param. +For each index type, the RESTful API has specific index parameters and search parameters. @@ -1507,45 +1543,43 @@ For each index type, it has specific index param and searach param.
Index typeCreate index paramSearch param
-You can find more details about parameters above [here](https://github.com/yamasite/docs/blob/v0.7.0/site/zh-CN/guides/index.md) - +For detailed information about the parameters above, refer to [Index Types](https://milvus.io/docs/v0.7.0/reference/index.md) ## Error Codes The RESTful API returns error messages as JSON text. Each type of error message has a specific error code. -| Type | Code | -|----------|------| -SUCCESS | 0 | -UNEXPECTED_ERROR | 1 | -CONNECT_FAILED | 2 | -PERMISSION_DENIED | 3 | -TABLE_NOT_EXISTS | 4 | -ILLEGAL_ARGUMENT | 5 | -ILLEGAL_RANGE | 6 | -ILLEGAL_DIMENSION | 7 | -ILLEGAL_INDEX_TYPE | 8 | -ILLEGAL_TABLE_NAME | 9 | -ILLEGAL_TOPK | 10 | -ILLEGAL_ROWRECORD | 11 | -ILLEGAL_VECTOR_ID | 12 | -ILLEGAL_SEARCH_RESULT | 13 | -FILE_NOT_FOUND | 14 | -META_FAILED | 15 | -CACHE_FAILED | 16 | -CANNOT_CREATE_FOLDER | 17 | -CANNOT_CREATE_FILE | 18 | -CANNOT_DELETE_FOLDER | 19 | -CANNOT_DELETE_FILE | 20 | -BUILD_INDEX_ERROR | 21 | -ILLEGAL_NLIST | 22 | -ILLEGAL_METRIC_TYPE | 23 | -OUT_OF_MEMORY | 24 | -PATH_PARAM_LOSS | 31 | -UNKNOWN_PATH | 32 | -QUERY_PARAM_LOSS | 33 | -BODY_FIELD_LOSS | 34 | -ILLEGAL_BODY | 35 | -BODY_PARSE_FAIL | 36 | -ILLEGAL_QUERY_PARAM | 37 | - +| Type | Code | +| --------------------- | ---- | +| SUCCESS | 0 | +| UNEXPECTED_ERROR | 1 | +| CONNECT_FAILED | 2 | +| PERMISSION_DENIED | 3 | +| TABLE_NOT_EXISTS | 4 | +| ILLEGAL_ARGUMENT | 5 | +| ILLEGAL_RANGE | 6 | +| ILLEGAL_DIMENSION | 7 | +| ILLEGAL_INDEX_TYPE | 8 | +| ILLEGAL_TABLE_NAME | 9 | +| ILLEGAL_TOPK | 10 | +| ILLEGAL_ROWRECORD | 11 | +| ILLEGAL_VECTOR_ID | 12 | +| ILLEGAL_SEARCH_RESULT | 13 | +| FILE_NOT_FOUND | 14 | +| META_FAILED | 15 | +| CACHE_FAILED | 16 | +| CANNOT_CREATE_FOLDER | 17 | +| CANNOT_CREATE_FILE | 18 | +| CANNOT_DELETE_FOLDER | 19 | +| CANNOT_DELETE_FILE | 20 | +| BUILD_INDEX_ERROR | 21 | +| ILLEGAL_NLIST | 22 | +| ILLEGAL_METRIC_TYPE | 23 | +| OUT_OF_MEMORY | 24 | +| PATH_PARAM_LOSS | 31 | +| UNKNOWN_PATH | 32 | +| QUERY_PARAM_LOSS | 33 | +| BODY_FIELD_LOSS | 34 | +| ILLEGAL_BODY | 35 | +| BODY_PARSE_FAIL | 36 | +| ILLEGAL_QUERY_PARAM | 37 | -- GitLab