# Error when saving Geo Shape defined in multiple fields

**URL:** <https://discuss.elastic.co/t/error-when-saving-geo-shape-defined-in-multiple-fields/370559>\
**Category:** Elasticsearch\
**Created:** [November 14, 2024, 1:39pm UTC](https://discuss.elastic.co/t/error-when-saving-geo-shape-defined-in-multiple-fields/370559 "2024-11-14T13:39:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanjaicariph](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johanjaicariph/32/139226_2.png) [@johanjaicariph](https://discuss.elastic.co/u/johanjaicariph)\
**Post date:** [November 14, 2024, 1:39pm UTC](https://discuss.elastic.co/t/error-when-saving-geo-shape-defined-in-multiple-fields/370559/1 "2024-11-14T13:39:33Z")

</div>

Hello, I have this index geo-test with this mapping:

```auto
{
  "mappings": {
    "properties": {
      "elasticSearchRequestList": {
        "type": "nested",
        "include_in_parent": true,
        "properties": {
          "_class": {
            "type": "keyword",
            "index": false,
            "doc_values": false
          },
          "searchData": {
            "properties": {
              "_class": {
                "type": "keyword",
                "index": false,
                "doc_values": false
              },
              "boundaries": {
                "type": "nested",
                "include_in_parent": true,
                "properties": {
                  "_class": {
                    "type": "keyword",
                    "index": false,
                    "doc_values": false
                  },
                  "geometryObject": {
                    "type": "geo_shape"
                  },
                  "range": {
                    "type": "double"
                  },
                  "uuid": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

```

when I want to save an document like this one:

```auto
{
  "elasticSearchRequestList": [
    {
      "searchData": {
        "boundaries": [
          {
            "geometryObject": {
              "type": "polygon",
              "coordinates": [
                [
                  [
                    -71,
                    40
                  ],
                  [
                    -72,
                    40
                  ],
                  [
                    -72,
                    41
                  ],
                  [
                    -71,
                    41
                  ],
                  [
                    -71,
                    40
                  ]
                ]
              ]
            }
          },
          {
            "geometryObject": {
              "type": "polygon",
              "coordinates": [
                [
                  [
                    -73,
                    42
                  ],
                  [
                    -74,
                    42
                  ],
                  [
                    -74,
                    43
                  ],
                  [
                    -73,
                    43
                  ],
                  [
                    -73,
                    42
                  ]
                ]
              ]
            }
          }
        ]
      }
    },
    {
      "searchData": {
        "boundaries": [
          {
            "geometryObject": {
              "type": "polygon",
              "coordinates": [
                [
                  [
                    -71,
                    40
                  ],
                  [
                    -72,
                    40
                  ],
                  [
                    -72,
                    41
                  ],
                  [
                    -71,
                    41
                  ],
                  [
                    -71,
                    40
                  ]
                ]
              ]
            }
          },
          {
            "geometryObject": {
              "type": "polygon",
              "coordinates": [
                [
                  [
                    -73,
                    42
                  ],
                  [
                    -74,
                    42
                  ],
                  [
                    -74,
                    43
                  ],
                  [
                    -73,
                    43
                  ],
                  [
                    -73,
                    42
                  ]
                ]
              ]
            }
          }
        ]
      }
    }
  ]
}

```

then I get this error:

DocValuesField "elasticSearchRequestList.searchData.boundaries.geometryObject" appears more than once in this document (only one value is allowed per field)

Can someone help please?  
Thanks

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [November 18, 2024, 7:44am UTC](https://discuss.elastic.co/t/error-when-saving-geo-shape-defined-in-multiple-fields/370559/2 "2024-11-18T07:44:17Z")

</div>

This is the same issue as the one explained here: [`include_in_root` with `geo_shape` is broken in 7 · Issue #70261 · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/issues/70261)

One possible solution here is to disable the doc values for geo\_shape.

```auto
{
  "mappings": {
    "properties": {
      "elasticSearchRequestList": {
        "type": "nested",
        "include_in_parent": true,
        "properties": {
          "_class": {
            "type": "keyword",
            "index": false,
            "doc_values": false
          },
          "searchData": {
            "properties": {
              "_class": {
                "type": "keyword",
                "index": false,
                "doc_values": false
              },
              "boundaries": {
                "type": "nested",
                "include_in_parent": true,
                "properties": {
                  "_class": {
                    "type": "keyword",
                    "index": false,
                    "doc_values": false
                  },
                  "geometryObject": {
                    "type": "geo_shape",
                    "doc_values" : false
                  },
                  "range": {
                    "type": "double"
                  },
                  "uuid": {
                    "type": "keyword"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}

```
