Nested JSon does getting indexed if mapping does not exist

In elasticsearch2.x, I created an index which has dynamic template set as
dynamic_templates": [
{
"others": {
"mapping": {
"norms": {
"enabled": false
},
"index": "analyzed",
"store": false,
"type": "string"
},
"match": "*"
}
}

I have constructed my Json as
"_instancename":[
"D-4"
],
"pxUpdateOperator":[
"Administrator@pega.com"
],
"WorkPartyPageList":[
{
"Role":[
"Developer",
"Developer"
],
"Subscript":[
"1"
],
"Urgency":[
"80.00",
"80.00"
]
},
{
"Role":[
"Tester",
"Tester"
],
"Subscript":[
"2"
],
"Urgency":[
"60.00",
"60.00"
]
},
{
"Role":[
"QA",
"QA"
],
"Subscript":[
"3"
],
"Urgency":[
"40.00",
"40.00"
]
}
],

Whihc means that WorkPartyPageList should be created as nested type.
It is working fine if I remove the dynamic template. With Dynamic tempalte it gives an exception when trying to index as
MapperParsingException[failed to parse [WorkPartyPageList]]; nested: IllegalArgumentException[unknown property [Role]];

The same works fine in elasticsearch 5.6.7 where fieldnames with dots are created with mapping type as object.

How do I make this work in Elasticsearch 2.x versions?

Forgot to mention this: If I remove my dynamic template nested objects are getting indexed

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