modified scripts for elastic search