TypeError: index() got an unexpected keyword argument ‘doc_type‘
Posted cuilll
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了TypeError: index() got an unexpected keyword argument ‘doc_type‘相关的知识,希望对你有一定的参考价值。
result = client.index(index='htmls',doc_type='doc', body=data)
TypeError: index() got an unexpected keyword argument 'doc_type'
es 版本升级之后,doc_type没有这个参数了
尝试安装低版本的
Remove: pip uninstall elasticsearch and then Install pip install elasticsearch==5.5.3
PS D:\\software2\\pycode> pip install elasticsearch==6.2.1
ERROR: Could not find a version that satisfies the requirement elasticsearch==6.2.1 (from versions: 0.4.1, 0.4.2, 0.4.3, 0.4.4, 0.4.5, 1.0
.0, 1.1.0, 1.1.1, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0, 1.9.0, 2.0.0, 2.1.0, 2.2.0, 2.3.0, 2.4.0, 2.4.1, 5.0.0, 5.0.1, 5.1.0, 5
.2.0, 5.3.0, 5.4.0, 5.5.0, 5.5.1, 5.5.2, 5.5.3, 6.0.0, 6.1.1, 6.2.0, 6.3.0, 6.3.1, 6.4.0, 6.8.0, 6.8.1, 6.8.2, 7.0.0, 7.0.1, 7.0.2, 7.0.3,
7.0.4, 7.0.5, 7.1.0, 7.5.1, 7.6.0a1, 7.6.0, 7.7.0a1, 7.7.0a2, 7.7.0, 7.7.1, 7.8.0a1, 7.8.0, 7.8.1, 7.9.0a1, 7.9.0, 7.9.1, 7.10.0a1, 7.10.
0a2, 7.10.0, 7.10.1, 7.11.0b1, 7.11.0, 7.12.0, 7.12.1, 7.13.0, 7.13.1, 7.13.2, 7.13.3, 7.13.4, 7.14.0a1, 7.14.0a2, 7.14.0, 7.14.1, 7.14.2,
7.15.0a1, 7.15.0, 7.15.1, 7.15.2, 7.16.0, 7.16.1, 7.16.2, 7.16.3, 7.17.0, 7.17.1, 7.17.2, 7.17.3, 7.17.4, 7.17.5, 7.17.6, 7.17.7, 7.17.8,
8.0.0a1, 8.0.0a2, 8.0.0a3, 8.0.0a4, 8.0.0b1, 8.0.0b2, 8.0.0, 8.0.1, 8.1.0, 8.1.1, 8.1.2, 8.1.3, 8.2.0, 8.2.1, 8.2.2, 8.2.3, 8.3.0, 8.3.1, 8.3.2, 8.3.3, 8.4.0, 8.4.1, 8.4.2, 8.4.3, 8.5.0, 8.5.1, 8.5.2, 8.5.3)
Seems your elasticsearch python client version is higher than v5.6.
Remove the existing one with a doc_type compatible version e.g 5.5.3
Remove: pip uninstall elasticsearch and then Install pip install elasticsearch==5.5.3
N.B I'm suggesting to do that because elasticsearch doesn't support multiple doc types
per index any more using doc_type
以上是关于TypeError: index() got an unexpected keyword argument ‘doc_type‘的主要内容,如果未能解决你的问题,请参考以下文章
pyinstaller打包任何py文件TypeError: an integer is required (got type bytes)
CUDA GPU 处理:TypeError: compile_kernel() got an unexpected keyword argument 'boundscheck'
PyTorch BERT TypeError: forward() got an unexpected keyword argument 'labels'
TypeError: __init__() got an unexpected keyword argument 'strict'
记录 TypeError: render() got an unexpected keyword argument 'renderer' 错误
Python libsvm: TypeError: __init__() got an unexpected keyword argument 'kernel_type'