Dynamic template for complex types

Sorry it took so long.
Here is how you can fix it:

DELETE test-loc
PUT test-loc
{
  "mappings": {
    "dynamic_templates": [
      {
        "geo": {
          "match_mapping_type": "object",
          "match": "*location",
          "mapping": {
            "type": "geo_point"
          }
        }
      }
    ]
  }
}

PUT test-loc/_doc/1
{
  "start_location": {
    "lon": 4.8995,
    "lat": 52.3824
  }
}

GET test-loc/_mapping

Tested on 7.5.

1 Like