无法向elasticsearch数据库插入数据bulk或者搜索数据search
报错内容
elasticsearch.ApiError: ApiError(406, ‘Content-Type header [application/vnd.elasticsearch+x-ndjson; compatible-with=8] is not supported’, ‘Content-Type header [application/vnd.elasticsearch+x-ndjson; compatible-with=8] is not supported’)
错误原因
错误的原因是python中的elasticsearch包的版本和服务器所安装的elasticsearch版本不一致。
解决方案
python中的elasticsearch包的版本和服务器所安装的elasticsearch版本调整为一致即可。