Search in sources :

Example 1 with UpdateSettingsRequestBuilder

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());
}
Also used : UpdateSettingsResponse(org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse) HashMap(java.util.HashMap) UpdateSettingsRequestBuilder(org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequestBuilder)

Example 2 with UpdateSettingsRequestBuilder

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();
}
Also used : UpdateSettingsRequestBuilder(org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequestBuilder)

Aggregations

UpdateSettingsRequestBuilder (org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequestBuilder)2 HashMap (java.util.HashMap)1 UpdateSettingsResponse (org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsResponse)1