Mapping for array of geo_point fields in elastic

Viewed 3109

I'd like to persist some JSON to elastic(search) that looks a little like this:

{
  "name": "value",
  "points": [
    { "lat": 0.0, "lon": 0.0 },
    { "lat": 1.0, "lon": 1.0 }
  ]
}

Points being a list of the type geo_point in elastic. Because they're geo_point values I need to define the index mapping, but the closest I can see is to do this:

"place": {
  "properties": {
    "name": {
      "type": "string"
    },
    "points": {
      "properties": {
        "location": {
          "type": "geo_point"
        }
      }
    }
  }
}

Which would mean having each point be a map with a single key of location and a geo_point value. I just want the geo_points, is this possible?

2 Answers
Related