From e868437fd56ef608e5a0a6aff463eb7e6e5266b8 Mon Sep 17 00:00:00 2001 From: Yhz Date: Tue, 10 Mar 2020 14:05:42 +0800 Subject: [PATCH 1/6] fix link error in http doc Signed-off-by: Yhz --- core/src/server/web_impl/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/server/web_impl/README.md b/core/src/server/web_impl/README.md index 6100894df9..8d28f44eed 100644 --- a/core/src/server/web_impl/README.md +++ b/core/src/server/web_impl/README.md @@ -517,7 +517,7 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection" -H "accept: a "metric_type": "L2", "count": 0, "index": "FLAT", - "index_params": {} + "index_params": {"nprobe": 16384} } ``` @@ -539,7 +539,7 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection?info=stat" -H "segments_stat": [ { "count": 1000, - "index": "IVFFLAT", + "index": "FLAT", "segment_name": "1583727170217439000", "size": 5284922 } @@ -681,7 +681,7 @@ Updates the index type and nlist of a collection. | 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 | +| `params` | The extra params of indexing method to query the collection. Please refer to `Index params`(see below) for detailed introduction of supported indexes. | No | ##### Query Parameters @@ -1122,7 +1122,7 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection/segments/15837 | `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 | +| `params` | Extra params for search. Please refer to `Search param`(see below) 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`. @@ -1543,7 +1543,7 @@ For each index type, the RESTful API has specific index parameters and search pa -For detailed information about the parameters above, refer to [Index Types](https://milvus.io/docs/v0.7.0/reference/index.md) +For detailed information about the parameters above, refer to [Index Types](https://milvus-io.github.io/milvus-sdk-python/pythondoc/v0.2.8/param.html) ## Error Codes From 84689fdac5860307e4d6556acac9635c77c51809 Mon Sep 17 00:00:00 2001 From: Yhz Date: Tue, 10 Mar 2020 14:09:19 +0800 Subject: [PATCH 2/6] [skip ci] update changlog Signed-off-by: Yhz --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cefe1fb6e..2023622910 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ Please mark all change in change log and use the issue from GitHub - \#1577 Row count incorrect if delete vectors then create index - \#1580 Old segment folder not removed after merge/compact if create_index is called before adding data - \#1590 Server down caused by failure to write file during concurrent mixed operations +- \#1601 External link bug in HTTP doc ## Feature - \#216 Add CLI to get server info From 1b5d299f58c24bd33481f1f154a7083739024338 Mon Sep 17 00:00:00 2001 From: Yhz Date: Tue, 10 Mar 2020 14:12:48 +0800 Subject: [PATCH 3/6] fix show tables results typo Signed-off-by: Yhz --- core/src/server/web_impl/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/server/web_impl/README.md b/core/src/server/web_impl/README.md index 8d28f44eed..4825446acd 100644 --- a/core/src/server/web_impl/README.md +++ b/core/src/server/web_impl/README.md @@ -391,7 +391,7 @@ $ curl -X GET "http://127.0.0.1:19121/collections?offset=0&page_size=1" -H "acce "metric_type": "L2", "count": 0, "index": "FLAT", - "nlist": 16384 + "index_params": {"nlist": 4096} } ], "count": 58 From 487bbfa7581c8b102559254bd4eb0c66790ed601 Mon Sep 17 00:00:00 2001 From: Yhz Date: Tue, 10 Mar 2020 14:35:16 +0800 Subject: [PATCH 4/6] change index type link address Signed-off-by: Yhz --- core/src/server/web_impl/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/server/web_impl/README.md b/core/src/server/web_impl/README.md index 4825446acd..8b5d786abb 100644 --- a/core/src/server/web_impl/README.md +++ b/core/src/server/web_impl/README.md @@ -1543,7 +1543,7 @@ For each index type, the RESTful API has specific index parameters and search pa -For detailed information about the parameters above, refer to [Index Types](https://milvus-io.github.io/milvus-sdk-python/pythondoc/v0.2.8/param.html) +For detailed information about the parameters above, refer to [Index Types](https://milvus.io/docs/v0.7.0/reference/index.md) ## Error Codes From 596d41b111c34d305ad01f9925d21877217a00dc Mon Sep 17 00:00:00 2001 From: Yhz Date: Tue, 10 Mar 2020 14:45:11 +0800 Subject: [PATCH 5/6] fix link error in http doc (fix #1601) Signed-off-by: Yhz --- core/src/server/web_impl/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/server/web_impl/README.md b/core/src/server/web_impl/README.md index 8b5d786abb..3abe5a462c 100644 --- a/core/src/server/web_impl/README.md +++ b/core/src/server/web_impl/README.md @@ -681,7 +681,7 @@ Updates the index type and nlist of a collection. | 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`(see below) for detailed introduction of supported indexes. | No | +| `params` | The extra params of indexing method to query the collection. Please refer to [Index and search parameters](#Index-and-search-parameters) for detailed introduction of supported indexes. | No | ##### Query Parameters @@ -1122,7 +1122,7 @@ $ curl -X GET "http://127.0.0.1:19121/collections/test_collection/segments/15837 | `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`(see below) to get more detail information. | Yes | +| `params` | Extra params for search. Please refer to [Index and search parameters](#Index-and-search-parameters) 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`. @@ -1510,7 +1510,7 @@ $ curl -X PUT "http://127.0.0.1:19121/system/task" -H "accept: application/json" { "code": 0, "message": "success" } ``` -## Index parameters +## Index and search parameters For each index type, the RESTful API has specific index parameters and search parameters. From f722119188f97830c6f32e355ad0a0e27d3317c4 Mon Sep 17 00:00:00 2001 From: Yhz Date: Tue, 10 Mar 2020 15:59:08 +0800 Subject: [PATCH 6/6] add options methods for system Signed-off-by: Yhz --- core/src/server/web_impl/controller/WebController.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/server/web_impl/controller/WebController.hpp b/core/src/server/web_impl/controller/WebController.hpp index 55a51168a3..f326578405 100644 --- a/core/src/server/web_impl/controller/WebController.hpp +++ b/core/src/server/web_impl/controller/WebController.hpp @@ -617,10 +617,7 @@ class WebController : public oatpp::web::server::api::ApiController { } ADD_CORS(VectorsOp) - /************* - * Search - * Delete by ID - * */ + ENDPOINT("PUT", "/collections/{collection_name}/vectors", VectorsOp, PATH(String, collection_name), BODY_STRING(String, body)) { TimeRecorder tr(std::string(WEB_LOG_PREFIX) + "PUT \'/collections/" + collection_name->std_str() + "/vectors\'"); @@ -648,6 +645,12 @@ class WebController : public oatpp::web::server::api::ApiController { return response; } + ADD_CORS(SystemOptions) + + ENDPOINT("OPTIONS", "/system/{info}", SystemOptions) { + return createResponse(Status::CODE_204, "No Content"); + } + ADD_CORS(SystemInfo) ENDPOINT("GET", "/system/{info}", SystemInfo, PATH(String, info), QUERIES(const QueryParams&, query_params)) {