@classmethod
def remote_reindex(cls, script=None, source_query=None, params=None,
    target_index=None, pipeline=None):
    """Reindex data from remote source.
    # requesting server ip should be in whitelist.
    # https://www.elastic.co/guide/en/elasticsearch/reference/current/reindex-upgrade-remote.html
    # when change something here also update the elastic py in mail magazine
    """
    booking_es = cls.get_connection()
    if not target_index:
        target_index = cls.get_index_name()
    if not params:
        params = {'wait_for_completion': 'false'}
    body = {'source': {'remote': {'host': 'http://%s' % cls.REMOTE_HOST},
        'index': cls.REMOTE_INDEX}, 'dest': {'index': target_index},
        'script': {'source': """
          ctx._type = 'doc';
        """,
        'lang': 'painless'}}
    if script:
        body.update(script)
    if source_query:
        if hasattr(cls, 'REMOTE_TYPE'):
            source_query['bool']['must'].append({'type': {'value': cls.
                REMOTE_TYPE}})
        body['source']['query'] = source_query
    if pipeline:
        body['dest']['pipeline'] = pipeline
    return booking_es.reindex(body, params=params)
