From b4027be33c307de44e5cb3d54c54012ec522647a Mon Sep 17 00:00:00 2001 From: MrPresent-Han Date: Fri, 5 Jan 2024 15:38:50 +0800 Subject: [PATCH] fix: to avoid zero value for width Signed-off-by: MrPresent-Han --- pymilvus/orm/iterator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pymilvus/orm/iterator.py b/pymilvus/orm/iterator.py index 4b7675bd4..50db692b4 100644 --- a/pymilvus/orm/iterator.py +++ b/pymilvus/orm/iterator.py @@ -344,6 +344,9 @@ def __update_width(self, page: SearchPage): self._width = last_hit.distance - first_hit.distance else: self._width = first_hit.distance - last_hit.distance + if self._width == 0.0: + self._width = 0.05 + # enable a minimum value for width to avoid radius and range_filter equal error def __set_up_range_parameters(self, page: SearchPage): self.__update_width(page)