diff --git a/cpp/src/server/RequestTask.cpp b/cpp/src/server/RequestTask.cpp index e553c036da95d0f0ad637b2da1467a5bc89fe83b..d6c1a2fb9c0594aba32691ea7be0f6cba797e051 100644 --- a/cpp/src/server/RequestTask.cpp +++ b/cpp/src/server/RequestTask.cpp @@ -513,7 +513,7 @@ ServerError SearchVectorTaskBase::OnExecute() { return SetError(res, "Invalid table name: " + table_name_); } - if(top_k_ <= 0) { + if(top_k_ <= 0 || top_k_ > 1024) { return SetError(SERVER_INVALID_TOPK, "Invalid topk: " + std::to_string(top_k_)); } if(record_array_.empty()) {