random documents are retrieved from ES cluster + some improvements on python code