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 ce28fe6812ee5..fa9de2845e48a 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 @@ -14,7 +14,6 @@ import org.apache.lucene.search.Pruning; import org.apache.lucene.search.comparators.NumericComparator; import org.apache.lucene.util.BitUtil; -import org.apache.lucene.util.NumericUtils; import java.io.IOException; @@ -103,12 +102,12 @@ public void copy(int slot, int doc) throws IOException { @Override protected long bottomAsComparableLong() { - return NumericUtils.floatToSortableInt(bottom); + return HalfFloatPoint.halfFloatToSortableShort(bottom); } @Override protected long topAsComparableLong() { - return NumericUtils.floatToSortableInt(topValue); + return HalfFloatPoint.halfFloatToSortableShort(topValue); } }