code: def query_doc(es, index_name, scroll_time="1s"):
      body = {
          "sort": [{"_id": {"order": "asc"}}],
          "query": {"match_all": {}},
          "size": 2000,
      }
      res = es.search(index=index_name, body=body, scroll=scroll_time)
      yield res
      scroll_id = res["_scroll_id"]
      while len(res["hits"]["hits"]):
          res = es.scroll(scroll_id=scroll_id, scroll=scroll_time)
          scroll_id = res["_scroll_id"]
          yield res
  
imports: from elasticsearch import Elasticsearch
  from apps.directory.utils import DICTIONARY_FILE
  import yaml
label_desc: Use image node_id 1 for calling a global function with example usage: query_doc(es, index_name, scroll_time) without return types