mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Fix: doc_aggs not correctly returned when no chunks retrieved. (#11578)
### What problem does this PR solve? Fix: doc_aggs not correctly returned when no chunks retrieved. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -424,6 +424,7 @@ class Dealer:
|
|||||||
|
|
||||||
sim_np = np.array(sim, dtype=np.float64)
|
sim_np = np.array(sim, dtype=np.float64)
|
||||||
if sim_np.size == 0:
|
if sim_np.size == 0:
|
||||||
|
ranks["doc_aggs"] = []
|
||||||
return ranks
|
return ranks
|
||||||
|
|
||||||
sorted_idx = np.argsort(sim_np * -1)
|
sorted_idx = np.argsort(sim_np * -1)
|
||||||
@ -433,6 +434,7 @@ class Dealer:
|
|||||||
ranks["total"] = int(filtered_count)
|
ranks["total"] = int(filtered_count)
|
||||||
|
|
||||||
if filtered_count == 0:
|
if filtered_count == 0:
|
||||||
|
ranks["doc_aggs"] = []
|
||||||
return ranks
|
return ranks
|
||||||
|
|
||||||
max_pages = max(RERANK_LIMIT // max(page_size, 1), 1)
|
max_pages = max(RERANK_LIMIT // max(page_size, 1), 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user