疲劳是最舒适的枕头,努力工作吧。

python操作es使用bulk时候报content-type(406)错误

Elasticsearch | 作者 yaok | 发布于2018年08月29日 | 阅读数:5250

elasticsearch.exceptions.TransportError: TransportError(406, u'Content-Type header is not supported')
已邀请:

JackGe

赞同来自: yaok

可以看下https://elasticsearch-py.readt ... lpers
def bulk(self, body, index=None, doc_type=None, params=None):
return self.transport.perform_request('POST', _make_path(index,
            doc_type, '_bulk'), params=params, body=self._bulk_body(body),
            headers={'content-type': 'application/x-ndjson'})
 

要回复问题请先登录注册