Elasticsearch Geo-Shape Slow Indexing Performance – Solved

           We were using Hosted Elasticsearch 1.4.4 to index geo-shape data with the following field mapping.

    "geoShapeField": {
        "type": "geo_shape",
        "tree": "quadtree",
        "tree_levels": 26 //Or use precision: "1m",
        "distance_error_pct": 0.025 // Optional, 0.025 is default

           Then we planned to move the cluster to AWS ES 6.2 and applied the same mapping except distance_error_pct. We noticed that indexing geo-shapes were very slow in AWS ES 6.2 due to a missing distance_error_pct configuration. In Elasticsearch 1.4.4, the distance_error_pct value is set to 0.025 by default. If we explicitly set the tree value, distance_error_pct  is set to 0 in Elasticsearch 6.2 by default.

           Set distance_error_pct  to 0 to gain maximum spatial precision with reduced indexing performance. The maximum value for distance_error_pct is 0.5. If you see any indexing issues after Elasticsearch upgrade for geo-shapes, set the distance_error_pct to 0.025 which is the default value in earlier versions of Elasticsearch.

  1. https://www.elastic.co/guide/en/elasticsearch/reference/1.4/mapping-geo-shape-type.html
  2. https://www.elastic.co/guide/en/elasticsearch/reference/6.2/geo-shape.html
  3. https://github.com/elastic/elasticsearch/issues/25833
  4. https://github.com/elastic/elasticsearch/issues/22087
  5. https://github.com/elastic/elasticsearch/issues/16444
  6. http://elasticsearch-users.115913.n3.nabble.com/Geo-shape-questions-td4028334.html


2 thoughts on “Elasticsearch Geo-Shape Slow Indexing Performance – Solved

Leave a Reply