FeatureCollection to geo_shape

Whats the right way to translate a geojson FeatureCollection to a es geo_shape?

I have a FeatureCollection looking like this:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [[[1.96, 42.455],[1.985,42.445]]]
      }
    },
    {
      "type": "Feature",
      "geometry": {
        "type": "Polygon",
        "coordinates": [...]
      }
    }
  ]
}

How can I translate this into the es geo_shape.
Currently I just index it like that (dropping type: Feature and type: FeatureCollection fields) and add a mapping saying:

"features": {
    "geometry": {
      "type": "geo_shape"
    }
}

This seems to work fine, but feels wrong, as I give an array of geometrys.
Is this okay or would the right way be to translate the FeatureCollection to type geometrycollection? Which clearly wants multiple geometry elements.

One Followup question, can I do a query a la: Give me all elements geometrically inside Element X in one query, without fetching X and than doing multiple follow up queries for each polygon?

So I just tried indexing once as geometrycollection and once as list of polygons as the example above. Both produce same search results for different queries, so is that just equivalent or can I produce different behavior somehow?

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