Code to process datasets for elastic search