@classmethod
def scan(cls, query=None, limit=1000, myindex=None, scroll='5m'):
    """Scan scroll for big pagination when you need to loop throw data bigger than max_result_window (defined in the top template).

    query: dict
    limit: int
    myindex: str or list
    scroll: string

    return {cls.get_index_name(): data(list), total: scroll_size(int), sid: sid(int)}
    """
    from elasticsearch import helpers
    conn = cls.get_connection()
    if not myindex:
        myindex = cls.get_index_name()
    elif isinstance(myindex, (list, tuple)):
        myindex = ','.join(myindex)
    return helpers.scan(conn, query=query, index=myindex, size=limit,
        scroll=scroll)
