首页 > 解决方案 > geojson 到 Elasticsearch:无法镶嵌形状

问题描述

我正在将一些 geojson 文件(大约 4000 ~ 5000 个多面特征)索引到 Elasticsearch 中。

这是映射

"mappings": {
       "properties": {
      "type": {
        "type": "keyword"
      },
      "properties": {
        "type": "object"
      },
      "geometry": {
        "type": "geo_shape"
      }
       }
    }

我的索引代码如下所示:

helpers.bulk(es, k, chunk_size=500, request_timeout=1000)

索引操作(在块中)被此错误消息停止:

{'type': 'mapper_parsing_exception', 'reason': 'failed to parse field [geometry] of type [geo_shape]', 'caused_by': {'type': 'illegal_argument_exception', 'reason': 'Unable to Tessellate shape

这个错误的原因是什么?
索引 geojson 文件时可以忽略此错误吗?

标签: pythonelasticsearchgeojsonelasticsearch-geo-shape

解决方案


我查看了这个问题,多边形是有效的,并发现了 Lucene tessellator 中的一个错误。我开了一个问题:

https://issues.apache.org/jira/browse/LUCENE-9417

修复在这里:

https://github.com/apache/lucene-solr/pull/1614


推荐阅读