Nested geo_shape's only stores the first shape

Given a mapping of:

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

And a query performing:

...
{
          "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?

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.

1 Like

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