# Nested JSon does getting indexed if mapping does not exist

**URL:** <https://discuss.elastic.co/t/nested-json-does-getting-indexed-if-mapping-does-not-exist/129231>\
**Category:** Elasticsearch\
**Created:** [April 24, 2018, 6:58am UTC](https://discuss.elastic.co/t/nested-json-does-getting-indexed-if-mapping-does-not-exist/129231 "2018-04-24T06:58:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yasaswani\_Koduri](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@Yasaswani\_Koduri](https://discuss.elastic.co/u/Yasaswani_Koduri)\
**Post date:** [April 24, 2018, 6:58am UTC](https://discuss.elastic.co/t/nested-json-does-getting-indexed-if-mapping-does-not-exist/129231/1 "2018-04-24T06:58:48Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Yasaswani\_Koduri](https://avatars.discourse-cdn.com/v4/letter/y/bcef8e/32.png) [@Yasaswani\_Koduri](https://discuss.elastic.co/u/Yasaswani_Koduri)\
**Post date:** [April 24, 2018, 8:53am UTC](https://discuss.elastic.co/t/nested-json-does-getting-indexed-if-mapping-does-not-exist/129231/2 "2018-04-24T08:53:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 22, 2018, 8:53am UTC](https://discuss.elastic.co/t/nested-json-does-getting-indexed-if-mapping-does-not-exist/129231/3 "2018-05-22T08:53:03Z")

</div>

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