Skip to content

Commit 6a4c23d

Browse files
committed
SNAPSHOT
1 parent e2a20ca commit 6a4c23d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

server/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.elasticsearch.action.admin.indices.segments.IndicesSegmentResponse;
1717
import org.elasticsearch.action.admin.indices.segments.IndicesSegmentsRequest;
1818
import org.elasticsearch.action.admin.indices.segments.ShardSegments;
19+
import org.elasticsearch.action.support.IndicesOptions;
1920
import org.elasticsearch.client.internal.node.NodeClient;
2021
import org.elasticsearch.cluster.node.DiscoveryNodes;
2122
import org.elasticsearch.common.Strings;
@@ -61,15 +62,17 @@ protected RestChannelConsumer doCatRequest(final RestRequest request, final Node
6162

6263
final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(getMasterNodeTimeout(request));
6364
RestUtils.consumeDeprecatedLocalParameter(request);
64-
clusterStateRequest.clear().nodes(true).routingTable(true).indices(indices);
65+
66+
IndicesOptions indicesOptions = IndicesOptions.fromRequest(request, IndicesOptions.lenientExpandOpen());
67+
clusterStateRequest.clear().nodes(true).routingTable(true).indices(indices).indicesOptions(indicesOptions);
6568

6669
final RestCancellableNodeClient cancelClient = new RestCancellableNodeClient(client, request.getHttpChannel());
6770

6871
return channel -> cancelClient.admin().cluster().state(clusterStateRequest, new RestActionListener<ClusterStateResponse>(channel) {
6972
@Override
7073
public void processResponse(final ClusterStateResponse clusterStateResponse) {
7174
final IndicesSegmentsRequest indicesSegmentsRequest = new IndicesSegmentsRequest();
72-
indicesSegmentsRequest.indices(indices);
75+
indicesSegmentsRequest.indices(indices).indicesOptions(indicesOptions);
7376
cancelClient.admin().indices().segments(indicesSegmentsRequest, new RestResponseListener<IndicesSegmentResponse>(channel) {
7477
@Override
7578
public RestResponse buildResponse(final IndicesSegmentResponse indicesSegmentResponse) throws Exception {

0 commit comments

Comments
 (0)