<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_elastic_items(elastic, elastic_scroll_id=None, limit=None):
 """ Get the items from the index """


    scroll_size = limit
    if not limit:
        scroll_size = DEFAULT_LIMIT

    if not elastic:
        return None

    url = elastic.index_url
    max_process_items_pack_time = "5m"  # 10 minutes
    url += "/_search?scroll=%s&size=%i" % (max_process_items_pack_time,
                                           scroll_size)

    if elastic_scroll_id:
        # Just continue with the scrolling
        url = elastic.url
        url += "/_search/scroll"
        scroll_data = {
            "scroll": max_process_items_pack_time,
            "scroll_id": elastic_scroll_id
        }
        res = requests.post(url, data=json.dumps(scroll_data))
    else:
        query = """
        {
            "query": {
                "bool": {
                    "must": []
                }
            }
        }
        """

        logging.debug("%s\n%s", url, json.dumps(json.loads(query), indent=4))
        res = requests.post(url, data=query)

    rjson = None
    try:
        rjson = res.json()
    except Exception:
        logging.error("No JSON found in %s", res.text)
        logging.error("No results found from %s", url)

    return rjson