How to create dynamic template for nested objects

I want to create a dynamic template for mapping the array of objects as nested type instead of object type automatically.

I have downloaded the basic template from curl -X GET "localhost:9200/_template". Please let me know where should I to change the type as nested for array of objects.

Please let me know if you require more details

Found the solution for this

{
"mappings" : {
"dynamic_templates": [
{
"objects": {
"match": "*",
"match_mapping_type" : "object",
"mapping": {
"type": "nested",
}
}
}
]
}
}

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