{
    "index_patterns": [
        "idai-field_*"
    ],
    "mappings": {
        "properties": {
            "resource": {
                "properties": {
                    "id": {
                        "type": "keyword",
                        "store": true
                    },
                    "identifier": {
                        "type": "keyword",
                        "store": true
                    },
                    "category": {
                        "type": "keyword",
                        "store": true
                    },
                    /* Elasticsearch does only support indexing wgs84
                       coordinates in the geo_shape field type. Thus
                       local geometry is only stored and not
                       coordinates are not indexed. */
                    "geometry": {
                        "properties": {
                            "coordinates": {
                                "type": "double",
                                "index": false
                            }
                        }
                    },
                    "geometry_wgs84": {
                        "type": "geo_shape",
                        "coerce": true
                    },
                    "material": {
                        "type": "keyword",
                        "store": true
                    },
                    "color": {
                        "type": "keyword",
                        "store": true
                    }
                }
            },
            "project": {
                "type": "keyword",
                "store": true
            },
            "created": {
                "properties": {
                    "date": {
                        "type": "date"
                    }
                }
            },
            "modified": {
                "properties": {
                    "date": {
                        "type": "date"
                    }
                }
            }
        },
        "dynamic_templates": [
            {
                "relations": {
                    "path_match": "relations.*",
                    "mapping": {
                        "type": "keyword",
                        "store": true
                    }
                }
            }
        ]
    }
}

{
    "index_patterns": [
        "idai-field_*"
    ],
    "mappings": {
        "properties": {
            "resource": {
                "properties": {
                    "id": {
                        "type": "keyword",
                        "store": true
                    },
                    "identifier": {
                        "type": "keyword",
                        "store": true
                    },
                    "category": {
                        "type": "keyword",
                        "store": true
                    },
                    /* Elasticsearch does only support indexing wgs84
                       coordinates in the geo_shape field type. Thus
                       local geometry is only stored and not
                       coordinates are not indexed. */
                    "geometry": {
                        "properties": {
                            "coordinates": {
                                "type": "double",
                                "index": false
                            }
                        }
                    },
                    "geometry_wgs84": {
                        "type": "geo_shape",
                        "coerce": true
                    },
                    "material": {
                        "type": "keyword",
                        "store": true
                    },
                    "color": {
                        "type": "keyword",
                        "store": true
                    }
                }
            },
            "project": {
                "type": "keyword",
                "store": true
            },
            "created": {
                "properties": {
                    "date": {
                        "type": "date"
                    }
                }
            },
            "modified": {
                "properties": {
                    "date": {
                        "type": "date"
                    }
                }
            }
        },
        "dynamic_templates": [
            {
                "relations": {
                    "path_match": "resource.relations.*.resource.identifier",
                    "mapping": {
                        "type": "keyword",
                        "store": true
                    }
                }
            }
        ]
    }
}

Adjust mapping to properly capture identifiers of nested resources
Adjust mapping to properly capture identifiers of nested resources
