def run(self, es):
        r = es.search(
            index=GEO_NAMES_INDEX_NAME,
            doc_type=GEO_NAMES_TYPE_NAME,
            sort="_doc",
            scroll="10s",
            size=self.ITEMS_PER_PAGE)
        self.scroll_id = r["_scroll_id"]
        # Note that starting with ES 2.0, the initial call to search() returns already the first result page
        # so we have to retrieve one page less
        for i in range(self.PAGES - 1):
            hit_count = len(r["hits"]["hits"])
            if hit_count == 0:
                # done
                break
            r = es.scroll(scroll_id=self.scroll_id, scroll="10s")
dataset/ETHPy150Open elastic/rally/esrally/track/geonames_track.py/ScrollQuery.run/original