Create index in Elastic Search by Java API
With replicas and shards settings:
Settings indexSettings = ImmutableSettings.settingsBuilder()
.put("number_of_shards", 1)
.put("number_of_replicas", 1)
.build();
CreateIndexRequest indexRequest = new CreateIndexRequest(index, indexSettings);
client.admin().indices().create(indexRequest).actionGet();
The port for TransportClient(via java API) is different than Http By default, transportClient port is 9300