Skip to content

Commit

Permalink
Use filter to search or delete should be limited by topN
Browse files Browse the repository at this point in the history
  • Loading branch information
zcdb committed Jun 19, 2023
1 parent dfcb620 commit 4d7011e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engine/search/gamma_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ int GammaEngine::Search(Request &request, Response &response_results) {
++(gamma_result->total);
if (gamma_result->results_count < topn) {
gamma_result->docs[(gamma_result->results_count)++]->docid = docid;
} else {
break;
}
}
}
Expand Down Expand Up @@ -935,6 +937,7 @@ int GammaEngine::DelDocByFilter(Request &request, char **del_ids,
}
++delete_num_;
++del_num;
if (del_num >= request.TopN()) break;
}
}
}
Expand Down

0 comments on commit 4d7011e

Please sign in to comment.