diff --git a/server/src/main/java/org/opensearch/index/search/comparators/HalfFloatComparator.java b/server/src/main/java/org/opensearch/index/search/comparators/HalfFloatComparator.java index ea3d6dae84194..6dc907550e303 100644 --- a/server/src/main/java/org/opensearch/index/search/comparators/HalfFloatComparator.java +++ b/server/src/main/java/org/opensearch/index/search/comparators/HalfFloatComparator.java @@ -56,7 +56,7 @@ public LeafFieldComparator getLeafComparator(LeafReaderContext context) throws I @Override protected long missingValueAsComparableLong() { - return NumericUtils.floatToSortableInt(missingValue); + return HalfFloatPoint.halfFloatToSortableShort(missingValue); } @Override @@ -108,7 +108,7 @@ protected long bottomAsComparableLong() { @Override protected long topAsComparableLong() { - return NumericUtils.floatToSortableInt(topValue); + return HalfFloatPoint.halfFloatToSortableShort(topValue); } }