Fixing error in java client documentation for creating indexes (#5354)

Signed-off-by: Samuel Valdes Gutierrez <valdesgutierrez@gmail.com>
This commit is contained in:
Samuel Valdes Gutierrez 2023-10-26 20:17:00 +01:00 committed by GitHub
parent f51f7a6524
commit bd14c328b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -295,9 +295,8 @@ CreateIndexRequest createIndexRequest = new CreateIndexRequest.Builder().index(i
client.indices().create(createIndexRequest); client.indices().create(createIndexRequest);
IndexSettings indexSettings = new IndexSettings.Builder().autoExpandReplicas("0-all").build(); IndexSettings indexSettings = new IndexSettings.Builder().autoExpandReplicas("0-all").build();
IndexSettingsBody settingsBody = new IndexSettingsBody.Builder().settings(indexSettings).build(); PutIndicesSettingsRequest putIndicesSettingsRequest = new PutIndicesSettingsRequest.Builder().index(index).value(indexSettings).build();
PutSettingsRequest putSettingsRequest = new PutSettingsRequest.Builder().index(index).value(settingsBody).build(); client.indices().putSettings(PutIndicesSettingsRequest);
client.indices().putSettings(putSettingsRequest);
``` ```
{% include copy.html %} {% include copy.html %}