client.admin().indices().prepareCreate("index_" + i)
.setSettings(ImmutableSettings.settingsBuilder().put("index.number_of_shards", numberOfShards).put("index.number_of_replicas", numberOfReplicas))
.execute().actionGet();
for (int j = 0; j < numberOfDocs; j++) {
client.prepareIndex("index_" + i, "type").setSource("field1", "test", "field2", 2, "field3", new Date()).execute().actionGet();
}
logger.info("DONE index [{}]", i);
}
client.admin().indices().prepareGatewaySnapshot().execute().actionGet();