}
IndicesAliasesRequest indicesAliasesRequest = new IndicesAliasesRequest();
indicesAliasesRequest.timeout(request.paramAsTime("timeout", indicesAliasesRequest.timeout()));
String[] aliases = new String[]{alias};
IndicesAliasesRequest.AliasActions aliasAction = new AliasActions(AliasAction.Type.ADD, indices, aliases);
indicesAliasesRequest.addAliasAction(aliasAction);
indicesAliasesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", indicesAliasesRequest.masterNodeTimeout()));
if (routing != null) {
aliasAction.routing(routing);
}
if (searchRouting != null) {
aliasAction.searchRouting(searchRouting);
}
if (indexRouting != null) {
aliasAction.indexRouting(indexRouting);
}
if (filter != null) {
aliasAction.filter(filter);
}
client.admin().indices().aliases(indicesAliasesRequest, new AcknowledgedRestListener<IndicesAliasesResponse>(channel));
}