From c011176a5883ff145ab51a11c3e610345ec15868 Mon Sep 17 00:00:00 2001 From: panguixin Date: Thu, 19 Dec 2024 13:35:58 +0800 Subject: [PATCH] fix Signed-off-by: panguixin --- .../org/opensearch/action/search/SearchPhaseController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java b/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java index 84f2578eb6e2b..9b6f904c99c4c 100644 --- a/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java +++ b/server/src/main/java/org/opensearch/action/search/SearchPhaseController.java @@ -623,11 +623,12 @@ private static Sort createSort(TopFieldDocs[] topFieldDocs) { SortField.Type sortType = getSortType(sortField); if (SortedWiderNumericSortField.isTypeSupported(sortType) == false) { // throw exception if sortType is not CUSTOM? + // skip this shard or do not widen? requireWiden = false; break; } - requireWiden = sortType != firstType; - isFloat = sortType == SortField.Type.FLOAT || sortType == SortField.Type.DOUBLE; + requireWiden = requireWiden || sortType != firstType; + isFloat = isFloat || sortType == SortField.Type.FLOAT || sortType == SortField.Type.DOUBLE; } if (requireWiden) {