来自\u index和\u bulkAPI的响应包含相当多的信息。此信息对于排除请求故障或实现重试逻辑非常有用,但可能会占用大量带宽。在本例中,索引32字节的文档将导致339字节的响应(包括标题):
如果我们更新/索引如下文档
PUT elasticsearch_domain/more-movies/_doc/1
{"title": "Back to the Future"}
它会返回如下的响应
{
"_index": "more-movies",
"_type": "_doc",
"_id": "1",
"_version": 4,
"result": "updated",
"_shards": {
"total": 2,
"successful": 2,
"failed": 0
},
"_seq_no": 3,
"_primary_term": 1
}
现在,如果我们使用_bulk
API在现有索引过程中使用过滤器路径
PUT elasticsearch_domain/more-movies/_doc/1?filter_path=result,_shards.total
{"title": "Back to the Future"}
然后反应会是
{
"result": "updated",
"_shards": {
"total": 2
}
}
所以我的问题是如何使用filter\u path过滤掉带有Elasticsearch-python bulk API或流式批量API的响应?
与搜索功能相同。试着这样做:
相关问题 更多 >
编程相关推荐