diff --git a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java index d8f2180208b18..9d6807176e6fe 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/settings/get/TransportGetSettingsAction.java @@ -130,6 +130,11 @@ protected void clusterManagerOperation(GetSettingsRequest request, ClusterState indexSettings = indexSettings.filter(k -> Regex.simpleMatch(request.names(), k)); } + indexSettings = Settings.builder() + .put(indexSettings) + .put(IndexMetadata.INDEX_NUMBER_OF_ROUTING_SHARDS_SETTING.getKey(), indexMetadata.getRoutingNumShards()) + .build(); + indexToSettingsBuilder.put(concreteIndex.getName(), indexSettings); if (request.includeDefaults()) { Settings defaultSettings = settingsFilter.filter(indexScopedSettings.diff(indexSettings, Settings.EMPTY));