0
Я пытаюсь создать динамический шаблон для вложенного объекта.Динамический шаблон ElasticSearch для вложенных
Вот документ индекс:
{
"title": "My title",
"attributes": {
"color": {
"id": 42,
"label": "red"
},
"material": {
"id": 43,
"label": "textile"
}
}
}
Это шаблон я безуспешно пытался
{
"dynamic": "false",
"dynamic_templates": [
{
"attributes": {
"path_match": "attributes",
"mapping": {
"type": "nested"
}
}
},
{
"attributes_nested": {
"path_match": "attributes.*",
"mapping": {
"properties": {
"id": {
"type": "integer"
},
"value": {
"type": "string"
}
}
}
}
}
],
"properties": {
"title": {
"type": "string"
}
}
}
Я хотел бы быть в состоянии сделать агрегированные на attributes.color.id и attributes.material.id