Setting DSL fields is invalid in restful api, fields are not returned (#4312)

Signed-off-by: fishpenguin <kun.yu@zilliz.com>
This commit is contained in:
yukun 2020-11-28 17:35:27 +08:00 committed by GitHub
parent b58a7b9bb0
commit b6dbbccd11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -19,6 +19,7 @@ Please mark all changes in change log and use the issue from GitHub
- \#4242 Fix query hang up at unittest case
- \#4246 Fix 'Illegal instruction' bug when running index tests at GitHub action
- \#4272 Program exit abnormally
- \#4302 Setting DSL fields is invalid in restful api, fields are not returned
## Feature
- \#4163 Update C++ sdk search interface

View File

@ -776,13 +776,13 @@ WebRequestHandler::Search(const std::string& collection_name, const nlohmann::js
field_type_.insert({field.first, field.second.field_type_});
}
auto query_json = json["query"];
milvus::json extra_params;
if (json.contains("fields")) {
if (json["fields"].is_array()) {
extra_params["fields"] = json["fields"];
if (query_json.contains("fields")) {
if (query_json["fields"].is_array()) {
extra_params["fields"] = query_json["fields"];
}
}
auto query_json = json["query"];
std::vector<std::string> partition_tags;
if (query_json.contains("partition_tags")) {