mirror of https://github.com/milvus-io/milvus.git
[skip ci] Fix mishards query result reduce error (#3256)
Signed-off-by: yinghao.zou <yinghao.zou@zilliz.com>pull/3267/head
parent
43c272fd13
commit
8a239355e3
|
@ -27,7 +27,8 @@ class ServiceHandler(milvus_pb2_grpc.MilvusServiceServicer):
|
|||
self.max_workers = max_workers
|
||||
|
||||
def _reduce(self, source_ids, ids, source_diss, diss, k, reverse):
|
||||
sort_f = lambda x, y: x >= y if reverse else lambda x, y: x <= y
|
||||
sort_f = (lambda x, y: x >= y) if reverse else (lambda x, y: x <= y)
|
||||
|
||||
if sort_f(source_diss[k - 1], diss[0]):
|
||||
return source_ids, source_diss
|
||||
if sort_f(diss[k - 1], source_diss[0]):
|
||||
|
|
Loading…
Reference in New Issue