createIndexWithCustomMappings(String indexName, String fieldsMapping){CreateIndexResponse createIndexResponse = client.admin().indices()
.prepareCreate(index).setSettings(fieldsMapping).execute().get();}
I have a code which creates the index in elastic search in a spring boot application. Currently the client used is transport client which is now depreciated as per elastic search documentation and now is replaced by High Level Rest Client.
For Creating Index using High Level Rest Client. I have seen this code.
CreateIndexRequest request = new CreateIndexRequest(indexName);
CreateIndexResponse createIndexResponse = client.indices().create(request, RequestOptions.DEFAULT);
Here fieldsMapping is a json file which has details regarding analyzer, tokenizer, filter and is passed as String to this method. I am not able to find methods in java rest high level client to incorporate setSettings(fieldsMapping).execute().get() as done above with transport client.
Any Idea on how this setSettings(fieldMappings) can work java high level rest client