Code for adding data to ES