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

(Anton) #1

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?

(David Pilato) #2

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

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

(Anton) #3

Correct - that worked, thank you.

(system) #4

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