Skip to content

Commit

Permalink
Set preference to _primary when searching control-center index (#911)
Browse files Browse the repository at this point in the history
* Set preference to _primary when searching control-center index

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Use _primary_first instead

Signed-off-by: gaobinlong <gbinlong@amazon.com>

---------

Signed-off-by: gaobinlong <gbinlong@amazon.com>
(cherry picked from commit a0f611d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Sep 1, 2023
1 parent 344d63c commit 987bc93
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_FIRST.type())

client.search(
searchRequest,
Expand Down

0 comments on commit 987bc93

Please sign in to comment.