插入数据时出现弹性搜索映射器解析异常



https://pastebin.com/Xu9CH4B1

我已经分享了上述数据示例,我正在尝试通过映射插入 Elasticsearch 中:

elastic_search.indices.put_mapping(
index=index_name_requester,
doc_type=doc_type_requester,
body={
"properties": {
"source_geocode.coordinates": {
"type": "geo_point"
},
"destination_geocode.coordinates": {
"type": "geo_point"
},
"geocodes": {
"type": "geo_shape"
},
"route_box": {
"type": "geo_shape"
},
"start_date_time": {
"type": "date",
"format": "YYYY-MM-dd'T'HH:mm:ss.SSSSSSZ||yyyy-MM-dd||epoch_millis"
}
}
}
)

弹性搜索版本: 6.3.2

预期行为: 插入成功

当前错误

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in insertion
File "/home/shobhit/.local/lib/python2.7/site-packages/elasticsearch/client/utils.py", line 76, in _wrapped
return func(*args, params=params, **kwargs)
File "/home/shobhit/.local/lib/python2.7/site-packages/elasticsearch/client/__init__.py", line 319, in index
_make_path(index, doc_type, id), params=params, body=body)
File "/home/shobhit/.local/lib/python2.7/site-packages/elasticsearch/transport.py", line 318, in perform_request
status, headers_response, data = connection.perform_request(method, url, params, body, headers=headers, ignore=ignore, timeout=timeout)
File "/home/shobhit/.local/lib/python2.7/site-packages/elasticsearch/connection/http_urllib3.py", line 186, in perform_request
self._raise_error(response.status, raw_data)
File "/home/shobhit/.local/lib/python2.7/site-packages/elasticsearch/connection/base.py", line 125, in _raise_error
raise HTTP_EXCEPTIONS.get(status_code, TransportError)(status_code, error_message, additional_info)
elasticsearch.exceptions.RequestError: RequestError(400, u'mapper_parsing_exception', u'failed to parse')

但是有一个类似的数据,正在插入更改的值,我分享了以下数据的链接:

https://pastebin.com/4cQzQQ0M

请帮助弄清楚数据有什么问题。谢谢!

我找到了问题的根源。这是经度的问题,在两种情况下,经度的格式都是错误的,但 1 个插入错误,另外 1 个不能。

日志中下面提到的行提到了正确的问题:

Caused by: java.lang.IllegalArgumentException: illegal latitude value [144.62810199999998] for source_geocode.coordinates

谢谢!!

最新更新