add error log for empty result (#2923)

* add error log for empty result

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

* add error log for empty result

Signed-off-by: groot <yihua.mo@zilliz.com>
pull/2933/head
groot 2020-07-18 19:30:29 +08:00 committed by GitHub
parent 23683f8477
commit f31a81ab16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -284,6 +284,10 @@ XSearchTask::Execute() {
search_job->vector_count() = nq; search_job->vector_count() = nq;
XSearchTask::MergeTopkToResultSet(output_ids, output_distance, spec_k, nq, topk, ascending_reduce, XSearchTask::MergeTopkToResultSet(output_ids, output_distance, spec_k, nq, topk, ascending_reduce,
search_job->GetResultIds(), search_job->GetResultDistances()); search_job->GetResultIds(), search_job->GetResultDistances());
if (search_job->GetResultIds().empty()) {
LOG_ENGINE_ERROR_ << "Result reduce error: result id array is empty";
}
} }
search_job->SearchDone(index_id_); search_job->SearchDone(index_id_);
index_engine_ = nullptr; index_engine_ = nullptr;
@ -320,6 +324,10 @@ XSearchTask::Execute() {
LOG_ENGINE_DEBUG_ << "Merged result: " LOG_ENGINE_DEBUG_ << "Merged result: "
<< "nq = " << nq << ", topk = " << topk << ", len of ids = " << output_ids.size() << "nq = " << nq << ", topk = " << topk << ", len of ids = " << output_ids.size()
<< ", len of distance = " << output_distance.size(); << ", len of distance = " << output_distance.size();
if (search_job->GetResultIds().empty()) {
LOG_ENGINE_ERROR_ << "Result reduce error: result id array is empty!";
}
} }
// span = rc.RecordSection(hdr + ", reduce topk"); // span = rc.RecordSection(hdr + ", reduce topk");