mirror of https://github.com/milvus-io/milvus.git
Signed-off-by: groot <yihua.mo@zilliz.com>pull/1833/head
parent
3e03850169
commit
f66b43b81b
|
@ -151,6 +151,15 @@ SearchCombineRequest::CanCombine(const SearchRequestPtr& request) {
|
|||
return false;
|
||||
}
|
||||
|
||||
// sum of nq must less-equal than MAX_NQ
|
||||
if (vectors_data_.vector_count_ > MAX_NQ || request->VectorsData().vector_count_ > MAX_NQ) {
|
||||
return false;
|
||||
}
|
||||
uint64_t total_nq = vectors_data_.vector_count_ + request->VectorsData().vector_count_;
|
||||
if (total_nq > MAX_NQ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// partition list must be equal for each one
|
||||
std::set<std::string> partition_list;
|
||||
GetUniqueList(request->PartitionList(), partition_list);
|
||||
|
|
|
@ -82,7 +82,7 @@ class SearchRequest : public BaseRequest {
|
|||
|
||||
private:
|
||||
const std::string collection_name_;
|
||||
const engine::VectorsData& vectors_data_;
|
||||
const engine::VectorsData vectors_data_;
|
||||
int64_t topk_;
|
||||
milvus::json extra_params_;
|
||||
const std::vector<std::string> partition_list_;
|
||||
|
|
|
@ -325,12 +325,12 @@ ValidationUtil::ValidateSearchParams(const milvus::json& search_params,
|
|||
Status
|
||||
ValidationUtil::ValidateVectorData(const engine::VectorsData& vectors,
|
||||
const engine::meta::CollectionSchema& table_schema) {
|
||||
if (vectors.float_data_.empty() && vectors.binary_data_.empty()) {
|
||||
uint64_t vector_count = vectors.vector_count_;
|
||||
if ((vectors.float_data_.empty() && vectors.binary_data_.empty()) || vector_count == 0) {
|
||||
return Status(SERVER_INVALID_ROWRECORD_ARRAY,
|
||||
"The vector array is empty. Make sure you have entered vector records.");
|
||||
}
|
||||
|
||||
uint64_t vector_count = vectors.vector_count_;
|
||||
if (engine::utils::IsBinaryMetricType(table_schema.metric_type_)) {
|
||||
// check prepared binary data
|
||||
if (vectors.binary_data_.size() % vector_count != 0) {
|
||||
|
|
Loading…
Reference in New Issue