private static TransportClient client = ElasticSearch.getClientSingle();
BulkRequestBuilder bulkRequestBuilder = client.prepareBulk();
List<Map<String,Object>> data = tbInformationMapper.tbData(map);
for(int i = 0; i < data.size(); i++) {
Map<String, Object> data= data.get(i);
bulkRequestBuilder.add(client.prepareIndex(index, type, data.get("id").toString()).setSource(data));
if (i % 1000 == 0) {
bulkRequestBuilder.execute().actionGet();
bulkRequestBuilder.request().requests().clear();
}
}
if(!bulkRequestBuilder.request().requests().isEmpty()) {
bulkRequestBuilder.execute().actionGet();
bulkRequestBuilder.request().requests().clear();
}