0

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

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

4

1 回答 1

0

我找到了问题的根源。这是 lat-long 的问题,在这两种情况下,lat-long 的格式都是错误的,但是 1 被错误地插入,而另一个 1 不能。

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

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

谢谢!!

于 2018-08-22T10:14:29.040 回答