def __init__(self, document):
        data = {}
        if '_source' in document:
            data = document['_source']
        if 'fields' in document:
            data.update(document['fields'])

        super(Result, self).__init__(data)
        # assign meta as attribute and not as key in self._d_
        super(AttrDict, self).__setattr__('meta', ResultMeta(document))
dataset/ETHPy150Open elastic/elasticsearch-dsl-py/elasticsearch_dsl/result.py/Result.__init__/original