diff --git a/_clients/java.md b/_clients/java.md index 2b8c776d23..c9cf7c0a63 100644 --- a/_clients/java.md +++ b/_clients/java.md @@ -295,9 +295,8 @@ CreateIndexRequest createIndexRequest = new CreateIndexRequest.Builder().index(i client.indices().create(createIndexRequest); IndexSettings indexSettings = new IndexSettings.Builder().autoExpandReplicas("0-all").build(); -IndexSettingsBody settingsBody = new IndexSettingsBody.Builder().settings(indexSettings).build(); -PutSettingsRequest putSettingsRequest = new PutSettingsRequest.Builder().index(index).value(settingsBody).build(); -client.indices().putSettings(putSettingsRequest); +PutIndicesSettingsRequest putIndicesSettingsRequest = new PutIndicesSettingsRequest.Builder().index(index).value(indexSettings).build(); +client.indices().putSettings(PutIndicesSettingsRequest); ``` {% include copy.html %}