mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Related to #44819 This fix addresses an issue(#44819) where the offset parameter did not work correctly during searches when multiple results had identical scores. The problem occurred because results with equal scores were not consistently ordered, leading to unpredictable pagination behavior. The solution adds a new sorting step (SortEqualScoresByPks) in the reduce phase that sorts results with identical scores by their primary keys in ascending order. This ensures deterministic ordering and enables proper offset functionality. Changes: - Add SortEqualScoresByPks() to sort results with equal scores by PK - Add SortEqualScoresOneNQ() to handle per-query sorting logic - Invoke sorting step after FillPrimaryKey() in Reduce() workflow --------- Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>