# Dynamic mapping with 3 level nested data

**URL:** <https://discuss.elastic.co/t/dynamic-mapping-with-3-level-nested-data/84576>\
**Category:** Elasticsearch\
**Created:** [May 4, 2017, 2:22pm UTC](https://discuss.elastic.co/t/dynamic-mapping-with-3-level-nested-data/84576 "2017-05-04T14:22:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishek5678](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@abhishek5678](https://discuss.elastic.co/u/abhishek5678)\
**Post date:** [May 4, 2017, 2:22pm UTC](https://discuss.elastic.co/t/dynamic-mapping-with-3-level-nested-data/84576/1 "2017-05-04T14:22:04Z")

</div>

Hi Everyone,  
I want to perform dynamic mapping with three level nested data but I am not able to get.If anybody knows about that then please help me.i am sending my mapping file and [data.so](http://data.so) In this way i am not able to get the correct mapping.  
INDEX:

PUT /icd10\_codes1  
{  
"settings": {  
"number\_of\_shards": 1,  
"analysis": {  
"filter": {  
"autocomplete\_filter": {  
"type": "edge\_ngram",  
"min\_gram": 1,  
"max\_gram": 20  
}  
},  
"analyzer": {  
"autocomplete": {  
"type": "custom",  
"tokenizer": "standard",  
"filter": [  
"lowercase",  
"autocomplete\_filter"  
]  
}  
}  
}  
}  
}

MAPPING:

PUT /icd10\_codes1/\_mapping/my\_type  
{  
"properties": {  
"name": {  
"type": "string",  
"analyzer": "autocomplete"  
},  
"depth":{  
"type":"long"  
},  
"dynamic\_templates": [{  
"nested\_children": {  
"match": "children",  
"match\_mapping\_type": "string",  
"mapping": {  
"index": "analyzed",  
"analyzer": "autocomplete"  
}  
}  
}],  
"dynamic\_templates": [{  
"nested\_children.children": {  
"match": "children.children",  
"match\_mapping\_type": "string",  
"mapping": {  
"index": "analyzed",  
"analyzer": "autocomplete"  
}  
}  
}],  
"dynamic\_templates": [{  
"nested\_children.children.children": {  
"match": "children.children.children",  
"match\_mapping\_type": "string",  
"mapping": {  
"index": "analyzed",  
"analyzer": "autocomplete"  
}  
}  
}]

```
      }
    }

```

DATA:

POST /icd10\_codes1/my\_type/1  
{  
"name": "Diseases of the blood and blood-forming organs and certain disorders involving the immune mechanism (D50-D89)",  
"depth": 1,  
"children": [{  
"name": "Nutritional anemias (D50-D53)",  
"depth": 2,  
"children": [{  
"code": "D50",  
"name": "Iron deficiency anemia",  
"depth": 3,  
"children": [{  
"code": "D50.0",  
"name": "Iron deficiency anemia secondary to blood loss (chronic)",  
"depth": 4  
}, {  
"code": "D50.1",  
"name": "Sideropenic dysphagia",  
"depth": 4  
}, {  
"code": "D50.8",  
"name": "Other iron deficiency anemias",  
"depth": 4  
}, {  
"code": "D50.9",  
"name": "Iron deficiency anemia, unspecified",  
"depth": 4  
}]  
}]  
}]  
}

---

<div class="post-metadata">

**Author:** ![abhishek5678](https://avatars.discourse-cdn.com/v4/letter/a/5daacb/32.png) [@abhishek5678](https://discuss.elastic.co/u/abhishek5678)\
**Post date:** [May 9, 2017, 10:11am UTC](https://discuss.elastic.co/t/dynamic-mapping-with-3-level-nested-data/84576/2 "2017-05-09T10:11:50Z")

</div>

I am waiting to reply for anyone

---

<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:** [June 6, 2017, 10:16am UTC](https://discuss.elastic.co/t/dynamic-mapping-with-3-level-nested-data/84576/3 "2017-06-06T10:16:53Z")

</div>

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