Java API - what is the correct way of updating the settings

I am using the java API version 5.3 and want to know the non-deprecated way of updating the index settings. Currently I use:

		final UpdateSettingsResponse response =   _myClient.admin().indices().prepareUpdateSettings().setSettings(newSettingsAsJson).setIndices(indexName).execute().actionGet();

But setSettings is deprecated as far as Eclipse is telling me.

Could you please tell me the new way of doing this?

Probably you need to set that the content you sent is JSON.

.setSettings(newSettingsAsJson, XContentType.JSON) from the top of my head.

Correct - that worked, thank you.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.