Skip to content

Commit

Permalink
Bug fix: in SearchIterator.checkRmRangeSearchParameters() a casting e…
Browse files Browse the repository at this point in the history
…rror from Double to float was raised (milvus-io#887)

The error occurred when SearchIterator was created via withParams called with a JSON configured with real numbers - see Issue milvus-io#887 for more details

Signed-off-by: PiercarloSlavazza <[email protected]>
  • Loading branch information
PiercarloSlavazza committed May 9, 2024
1 parent 7674ae4 commit 4ba8b28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/io/milvus/orm/iterator/SearchIterator.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ private void checkForSpecialIndexParam() {

private void checkRmRangeSearchParameters() {
if (params.containsKey(RADIUS) && params.containsKey(RANGE_FILTER)) {
float radius = (float) params.get(RADIUS);
float rangeFilter = (float) params.get(RANGE_FILTER);
double radius = (double) params.get(RADIUS);
double rangeFilter = (double) params.get(RANGE_FILTER);
if (metricsPositiveRelated(metricType) && radius <= rangeFilter) {
String msg = String.format("for metrics:%s, radius must be larger than range_filter, please adjust your parameter", metricType);
ExceptionUtils.throwUnExpectedException(msg);
Expand Down

0 comments on commit 4ba8b28

Please sign in to comment.