make this script to pull input from ElasticSearch