From 07903858dc414392b01ae474644e6ce15c9995e6 Mon Sep 17 00:00:00 2001 From: Jackie Han Date: Thu, 1 Feb 2024 12:31:21 -0800 Subject: [PATCH] test Signed-off-by: Jackie Han --- .../flowframework/workflow/RankSearchResultStep.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/opensearch/flowframework/workflow/RankSearchResultStep.java b/src/main/java/org/opensearch/flowframework/workflow/RankSearchResultStep.java index 25c946e32..c8325b752 100644 --- a/src/main/java/org/opensearch/flowframework/workflow/RankSearchResultStep.java +++ b/src/main/java/org/opensearch/flowframework/workflow/RankSearchResultStep.java @@ -40,8 +40,8 @@ public SearchHits rankAsec(SearchHits hits) { List sortedHits = originalHits.stream() .sorted((hit1, hit2) -> { // Extract the "aa" field values as Double from the source maps of hit1 and hit2 - Double aa1 = toDouble(hit1.getSourceAsMap().get("aa")); - Double aa2 = toDouble(hit2.getSourceAsMap().get("aa")); + Double aa1 = toDouble(hit1.getSourceAsMap().get("sepal_length_in_cm")); + Double aa2 = toDouble(hit2.getSourceAsMap().get("sepal_length_in_cm")); // Use Double.compare to compare the "aa" field values, handling nulls return Double.compare(aa1 != null ? aa1 : Double.MIN_VALUE, aa2 != null ? aa2 : Double.MIN_VALUE);