extracting data from elasticsearch