# Nested geo\_shape's only stores the first shape

**URL:** <https://discuss.elastic.co/t/nested-geo-shapes-only-stores-the-first-shape/241448>\
**Category:** Elasticsearch\
**Created:** [July 16, 2020, 12:10pm UTC](https://discuss.elastic.co/t/nested-geo-shapes-only-stores-the-first-shape/241448 "2020-07-16T12:10:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aes](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@aes](https://discuss.elastic.co/u/aes)\
**Post date:** [July 16, 2020, 12:10pm UTC](https://discuss.elastic.co/t/nested-geo-shapes-only-stores-the-first-shape/241448/1 "2020-07-16T12:10:25Z")

</div>

Given a mapping of:

```auto
...
"polygons": { - 
          "type": "nested",
          "properties": { - 
            "polygon": { - 
              "type": "geo_shape"
            },
            "name": { - 
              "type": "keyword"
            }
          }
        }
...

```

And a query performing:

```auto
...
{
          "geo_shape": {
            "location": {
              "indexed_shape": {
                "id": 1111,
                "index": "myindex",
                "path": "polygons.polygon"
              },
              "relation": "within"
            }
          }
        }
...

```

The indexed shape only stores a shape for the first item in the nested array, and if the actual hit is a later child (i.e. not the first) a false negative is given - no results.

Is it possible to use all of the nested array children shapes?

---

<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:** [July 16, 2020, 1:46pm UTC](https://discuss.elastic.co/t/nested-geo-shapes-only-stores-the-first-shape/241448/2 "2020-07-16T13:46:57Z")

</div>

I am afraid it is not possible and yes, it currently fetches the first shape it founds under `path`. Not sure if it is a feature or a bug, please feel free to open a GitHub issue so it can be reviewed by the corresponding team.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 13, 2020, 1:46pm UTC](https://discuss.elastic.co/t/nested-geo-shapes-only-stores-the-first-shape/241448/3 "2020-08-13T13:46:58Z")

</div>

Closed on August 13, 2020, 1:46pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
