dict 合并
print({**{"1": 1, "2": 2}, **{"1": 3}})
# {"1": 3, "2": 2}
results = {"_id": "123", "_source": {"name": "ax", "age": 18}}
print({**results["_source"], **{"id": results["_id"]}})
# {'id': '123', 'age': 18, 'name': 'ax'}
results = [{"_id": "123", "_source": {"name": "ax", "age": 18}}, {"_id": "456", "_source": {"name": "bubu", "age": 3}}]
print(list(map(lambda doc: {**doc["_source"], **{"id": doc["_id"]}}, results)))
# [{'id': '123', 'age': 18, 'name': 'ax'}, {'id': '456', 'age': 3, 'name': 'bubu'}]