From a0f611df52f45da1b269f2d804f707c8be173822 Mon Sep 17 00:00:00 2001 From: gaobinlong Date: Fri, 1 Sep 2023 11:37:01 +0800 Subject: [PATCH] Set preference to _primary when searching control-center index (#911) * Set preference to _primary when searching control-center index Signed-off-by: gaobinlong * Use _primary_first instead Signed-off-by: gaobinlong --------- Signed-off-by: gaobinlong --- .../notification/action/get/TransportGetLRONConfigAction.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt index 6c43d93a6..25c2a42a8 100644 --- a/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt +++ b/src/main/kotlin/org/opensearch/indexmanagement/controlcenter/notification/action/get/TransportGetLRONConfigAction.kt @@ -13,6 +13,7 @@ import org.opensearch.action.search.SearchResponse import org.opensearch.action.support.ActionFilters import org.opensearch.action.support.HandledTransportAction import org.opensearch.client.node.NodeClient +import org.opensearch.cluster.routing.Preference import org.opensearch.common.inject.Inject import org.opensearch.common.xcontent.LoggingDeprecationHandler import org.opensearch.common.xcontent.XContentHelper @@ -93,6 +94,7 @@ class TransportGetLRONConfigAction @Inject constructor( val searchRequest = SearchRequest() .source(searchSourceBuilder) .indices(IndexManagementPlugin.CONTROL_CENTER_INDEX) + .preference(Preference.PRIMARY_FIRST.type()) client.search( searchRequest,