Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Jackie Han <[email protected]>
  • Loading branch information
jackiehanyang committed Feb 1, 2024
1 parent 2cae54c commit 0790385
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public SearchHits rankAsec(SearchHits hits) {
List<SearchHit> 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);
Expand Down

0 comments on commit 0790385

Please sign in to comment.