def _convert_results_to_dict(r):
    if 'fields' in r:
        return r['fields']
    if '_source' in r:
        return r['_source']
    return {'id': r['_id']}
Takes a results from Elasticsearch and returns fields.
dataset/ETHPy150Open mozilla/elasticutils/elasticutils/__init__.py/_convert_results_to_dict