Reputation: 1065
Is it possible to make all nested objects in elastic search automatically map to the type nested by default. Instead of object?
Upvotes: 3
Views: 530
Reputation: 217334
Yes, you can do it by using the following dynamic template when creating your index:
PUT my_index
{
"mappings": {
"my_type": {
"dynamic_templates": [
{
"nested": {
"match_mapping_type": "object",
"mapping": {
"type": "nested"
}
}
}
]
}
}
}
Upvotes: 5