在python elasticsearch clien中使用http\u compress会导致协议错误(连接中止,BadStatusLine)

2024-04-23 08:42:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我在python elasticsearch客户端上遇到了一个问题,它

ProtocolError(('Connection aborted.', BadStatusLine("''",))) 使用http_compress = True时出错,如下所示

Elasticsearch(hosts = host_config,retry_on_timeout=True,maxsize=100,
                                    http_compress=True)

如果我删除http_compress,那么一切都正常。这里可能出了什么问题?你知道吗

我按照python elasticsearch客户端文档的建议使用http\u compress

When using capacity constrained networks (low throughput), it may be handy to enable compression. This is especially useful when doing bulk loads or inserting large documents. This will configure compression on the request.

注意:我正在尝试使用parallel\u bulk helper函数将文档批量索引到elasticsearch。你知道吗

Elasticsearch版本:6.8

客户端版本:6.3.0

python版本:2.7


Tags: 文档版本truehttp客户端onbulkconnection