|
16 | 16 | import org.elasticsearch.action.admin.indices.segments.IndicesSegmentResponse;
|
17 | 17 | import org.elasticsearch.action.admin.indices.segments.IndicesSegmentsRequest;
|
18 | 18 | import org.elasticsearch.action.admin.indices.segments.ShardSegments;
|
| 19 | +import org.elasticsearch.action.support.IndicesOptions; |
19 | 20 | import org.elasticsearch.client.internal.node.NodeClient;
|
20 | 21 | import org.elasticsearch.cluster.node.DiscoveryNodes;
|
21 | 22 | import org.elasticsearch.common.Strings;
|
@@ -61,15 +62,17 @@ protected RestChannelConsumer doCatRequest(final RestRequest request, final Node
|
61 | 62 |
|
62 | 63 | final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(getMasterNodeTimeout(request));
|
63 | 64 | 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); |
65 | 68 |
|
66 | 69 | final RestCancellableNodeClient cancelClient = new RestCancellableNodeClient(client, request.getHttpChannel());
|
67 | 70 |
|
68 | 71 | return channel -> cancelClient.admin().cluster().state(clusterStateRequest, new RestActionListener<ClusterStateResponse>(channel) {
|
69 | 72 | @Override
|
70 | 73 | public void processResponse(final ClusterStateResponse clusterStateResponse) {
|
71 | 74 | final IndicesSegmentsRequest indicesSegmentsRequest = new IndicesSegmentsRequest();
|
72 |
| - indicesSegmentsRequest.indices(indices); |
| 75 | + indicesSegmentsRequest.indices(indices).indicesOptions(indicesOptions); |
73 | 76 | cancelClient.admin().indices().segments(indicesSegmentsRequest, new RestResponseListener<IndicesSegmentResponse>(channel) {
|
74 | 77 | @Override
|
75 | 78 | public RestResponse buildResponse(final IndicesSegmentResponse indicesSegmentResponse) throws Exception {
|
|
0 commit comments