PYES异常: TypeError: 'NoneType' object is not callable

2020-08-21 01:28:59 浏览数 (1)

在执行pyes脚本时报出以下异常

代码语言:javascript复制
Traceback (most recent call last):
  File "indextest.py", line 18, in <module>
    conn.indices.put_mapping("test-type", {'properties':mapping}, ["test-index"])
  File "/usr/lib/python2.7/site-packages/pyes/managers.py", line 440, in put_mapping
    return self.conn._send_request('PUT', path, mapping, params=parameters)
  File "/usr/lib/python2.7/site-packages/pyes/es.py", line 486, in _send_request
    raise_if_error(response.status, decoded)
  File "/usr/lib/python2.7/site-packages/pyes/convert_errors.py", line 74, in raise_if_error
    bits = error.split('[', 1)
TypeError: 'NoneType' object is not callable

这个异常通常都是由mapping中的部分字段类型设置错误,或者索引和映射书写有错误,以及格式错误导致的。

0 人点赞