Skip to content

Commit

Permalink
Set preference to _primary when searching control-center index
Browse files Browse the repository at this point in the history
Signed-off-by: gaobinlong <[email protected]>
  • Loading branch information
gaobinlong committed Aug 30, 2023
1 parent c2ccf7e commit 1560d15
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -93,6 +94,7 @@ class TransportGetLRONConfigAction @Inject constructor(
val searchRequest = SearchRequest()
.source(searchSourceBuilder)
.indices(IndexManagementPlugin.CONTROL_CENTER_INDEX)
.preference(Preference.PRIMARY.type())

client.search(
searchRequest,
Expand Down

0 comments on commit 1560d15

Please sign in to comment.