From d7c47a79058ee9cffe2e6aeec9a4b9b6c4dac9c5 Mon Sep 17 00:00:00 2001 From: groot Date: Fri, 10 Jul 2020 16:49:47 +0800 Subject: [PATCH] fix #2752 (#2789) * fix #2752 Signed-off-by: yhmo * typo Signed-off-by: yhmo * typo Signed-off-by: yhmo --- CHANGELOG.md | 1 + core/src/server/web_impl/handler/WebRequestHandler.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 978efae8f3..4e44d79764 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Please mark all change in change log and use the issue from GitHub - \#2690 Remove body parser in show-partitions endpoints - \#2692 Milvus hangs during multi-thread concurrent search - \#2739 Fix mishards start failed +- \#2752 Milvus formats vectors data to double-precision and return to http client - \#2767 fix a bug of getting wrong nprobe limitation in knowhere on GPU version - \#2776 Fix too many data copies during creating IVF index diff --git a/core/src/server/web_impl/handler/WebRequestHandler.cpp b/core/src/server/web_impl/handler/WebRequestHandler.cpp index b857220dce..69adb6e76c 100644 --- a/core/src/server/web_impl/handler/WebRequestHandler.cpp +++ b/core/src/server/web_impl/handler/WebRequestHandler.cpp @@ -78,6 +78,8 @@ WebErrorMap(ErrorCode code) { } } +using FloatJson = nlohmann::basic_json; + /////////////////////////////////// Private methods /////////////////////////////////////// void WebRequestHandler::AddStatusToJson(nlohmann::json& json, int64_t code, const std::string& msg) { @@ -1690,8 +1692,9 @@ WebRequestHandler::GetVector(const OString& collection_name, const OQueryParams& ASSIGN_RETURN_STATUS_DTO(status) } - nlohmann::json json; - AddStatusToJson(json, status.code(), status.message()); + FloatJson json; + json["code"] = (int64_t)status.code(); + json["message"] = status.message(); if (vectors_json.empty()) { json["vectors"] = std::vector(); } else {