Skip to content

Commit

Permalink
fix #2752 (#2789)
Browse files Browse the repository at this point in the history
* fix #2752

Signed-off-by: yhmo <yihua.mo@zilliz.com>

* typo

Signed-off-by: yhmo <yihua.mo@zilliz.com>

* typo

Signed-off-by: yhmo <yihua.mo@zilliz.com>
(cherry picked from commit d7c47a7)
  • Loading branch information
groot authored and wxywb committed Jul 11, 2020
1 parent 9d4febd commit f94592e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -20,6 +20,7 @@ Please mark all changes 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

Expand Down
7 changes: 5 additions & 2 deletions core/src/server/web_impl/handler/WebRequestHandler.cpp
Expand Up @@ -78,6 +78,8 @@ WebErrorMap(ErrorCode code) {
}
}

using FloatJson = nlohmann::basic_json<std::map, std::vector, std::string, bool, std::int64_t, std::uint64_t, float>;

/////////////////////////////////// Private methods ///////////////////////////////////////
void
WebRequestHandler::AddStatusToJson(nlohmann::json& json, int64_t code, const std::string& msg) {
Expand Down Expand Up @@ -1881,8 +1883,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<int64_t>();
} else {
Expand Down

0 comments on commit f94592e

Please sign in to comment.