elasticsearch py:索引文档后如何返回`\u source`字段?

gjmwrych  于 2021-06-15  发布在  ElasticSearch
关注(0)|答案(0)|浏览(280)
>>> es.index(index="my-index", id=42, body={"any": "data", "timestamp": datetime.now()})
{'_index': 'my-index',
 '_type': '_doc',
 '_id': '42',
 '_version': 1,
 'result': 'created',
 '_shards': {'total': 2, 'successful': 1, 'failed': 0},
 '_seq_no': 0,
 '_primary_term': 1}

上面的示例返回除实际文档以外的所有内容。有人知道能不能回来吗 _source 成功也是如此?

>>> es.get(index="my-index", id=42)

我知道上述情况,但这将意味着一个全新的电话。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题