events.add(evt);
nSynced++;
if ( events.size() > 1000 )
{
elasticManager.bulkAddDocuments(IndexManager.mapListToIndex(events, AssociationFeaturePojo.listType(), new AssociationFeaturePojoIndexMap()), "_id", null,true);
events.clear();
}
}
// End loop over entities
//write whatevers left
elasticManager.bulkAddDocuments(IndexManager.mapListToIndex(events, AssociationFeaturePojo.listType(), new AssociationFeaturePojoIndexMap()), "_id", null,true);
if (null != chunk) {
System.out.println("Found " + nSynced + " records to sync in chunk");
}
}