@classmethod
def get_by_ids(cls, ids, with_total=True, sort=None):
    """Get the documents by their ids render an id dict.

    ids: [int]
    with_total: bool
    sort: [list]

    return: dict

    """
    if sort:
        query = {'query': {'ids': {'values': ids}}, 'size': len(ids)}
        query['sort'] = sort
        result = cls.search(query=query)
        formatted_result, total = cls.render_map(result, with_total=with_total)
        return {'total': total, cls.get_index_name(): formatted_result}
    else:
        return cls.mget(ids)
