use of org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequestBuilder in project elasticsearch by elastic.
the class SimpleBlocksIT method setIndexReadOnly.
private void setIndexReadOnly(String index, Object value) {
HashMap<String, Object> newSettings = new HashMap<>();
newSettings.put(IndexMetaData.SETTING_READ_ONLY, value);
UpdateSettingsRequestBuilder settingsRequest = client().admin().indices().prepareUpdateSettings(index);
settingsRequest.setSettings(newSettings);
UpdateSettingsResponse settingsResponse = settingsRequest.execute().actionGet();
assertThat(settingsResponse, notNullValue());
}
use of org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequestBuilder in project sonarqube by SonarSource.
the class BulkIndexer method updateSettings.
private void updateSettings(Map<String, Object> settings) {
UpdateSettingsRequestBuilder req = client.nativeClient().admin().indices().prepareUpdateSettings(indexName);
req.setSettings(settings);
req.get();
}
Aggregations