Put Settings API

edit

The Put Settings API allows you to modify any index setting that is dynamic:

$params['index'] = 'my_index';
$params['body']['index']['number_of_replicas'] = 0;
$params['body']['index']['refresh_interval'] = -1;

$ret = $client->indices()->putSettings($params);