code: private static void createIndexWithSettingsInElasticsearch(RestClient client, String index, String settings) throws Exception {
  		logger.trace("createIndex([{}])", index);
  
  		assert client != null;
  		assert index != null;
  
          Request request = new Request("PUT", "/" + index);
  
  		// If there are settings for this index, we use it. If not, using Elasticsearch defaults.
  		if (settings != null) {
  			logger.trace("Found settings for index [{}]: [{}]", index, settings);
  			request.setJsonEntity(settings);
  		}
  
          Response response = client.performRequest(request);
  		if (response.getStatusLine().getStatusCode() != 200) {
  			logger.warn("Could not create index [{}]", index);
  			throw new Exception("Could not create index ["+index+"].");
  		}
  
  		logger.trace("/createIndex([{}])", index);
  	}
docs: Create a new index in Elasticsearch
  @param client Elasticsearch client
  @param index Index name
  @param settings Settings if any, null if no specific settings
  @throws Exception if the elasticsearch API call is failing