controller.registerHandler(GET, "/{index}/_refresh", this);
}
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
RefreshRequest refreshRequest = new RefreshRequest(Strings.splitStringByCommaToArray(request.param("index")));
refreshRequest.listenerThreaded(false);
refreshRequest.force(request.paramAsBoolean("force", refreshRequest.force()));
refreshRequest.indicesOptions(IndicesOptions.fromRequest(request, refreshRequest.indicesOptions()));
client.admin().indices().refresh(refreshRequest, new RestBuilderListener<RefreshResponse>(channel) {
@Override
public RestResponse buildResponse(RefreshResponse response, XContentBuilder builder) throws Exception {
builder.startObject();
buildBroadcastShardsHeader(builder, response);