mirror of
https://github.com/milvus-io/milvus.git
synced 2026-07-21 10:15:43 +00:00
fix: remove false-pass bypass in check_search_results for empty hits
Remove the `if len(hits) == 0: continue` guard that silently skipped limit verification when search returned no results. The existing limit check (len(hits) != limit) already handles this correctly — when limit is specified and hits is empty, the assertion properly fails. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: yanliang567 <82361606+yanliang567@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
413cfafd72
commit
0e4ad86c13
@@ -453,8 +453,6 @@ class ResponseChecker:
|
||||
else:
|
||||
ids = list(hits.ids)
|
||||
distances = list(hits.distances)
|
||||
if len(hits) == 0:
|
||||
continue
|
||||
if check_items.get("limit", None) is not None \
|
||||
and ((len(hits) != check_items["limit"]) or (len(set(ids)) != check_items["limit"])):
|
||||
log.error("search_results_check: limit(topK) searched (%d) "
|
||||
|
||||
Reference in New Issue
Block a user