# Newbie questions on mapping

**URL:** <https://discuss.elastic.co/t/newbie-questions-on-mapping/197606>\
**Category:** Elasticsearch\
**Created:** [August 31, 2019, 7:12pm UTC](https://discuss.elastic.co/t/newbie-questions-on-mapping/197606 "2019-08-31T19:12:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lhartzman](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lhartzman](https://discuss.elastic.co/u/lhartzman)\
**Post date:** [August 31, 2019, 7:12pm UTC](https://discuss.elastic.co/t/newbie-questions-on-mapping/197606/1 "2019-08-31T19:12:37Z")

</div>

I just started to investigate Elasticsearch since my company uses it. I took a section of a mapping and used it to create a new index on a new ES instance and don't understand what happened.

The mapping has a dynamic template defined in it that is an array of items, including entries with _path\_match_ statements. But when I query for the mapping after posting it, what is returned is a non-array _dynamic\_template_ and the paths (regex) looked like "itemName\...+" don't even show up when I get the mapping.

So what is happening here? What kind of transformation took place? Where did the path\_match text go to?

Thanks.

Les

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [September 1, 2019, 2:59pm UTC](https://discuss.elastic.co/t/newbie-questions-on-mapping/197606/2 "2019-09-01T14:59:33Z")

</div>

Can you show the template as well as resulting mapping?

---

<div class="post-metadata">

**Author:** ![lhartzman](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lhartzman](https://discuss.elastic.co/u/lhartzman)\
**Post date:** [September 3, 2019, 4:36am UTC](https://discuss.elastic.co/t/newbie-questions-on-mapping/197606/3 "2019-09-03T04:36:26Z")

</div>

Since I can't post the full response, I've posted the initial part:

What was POSTed to create the index mapping:

{  
"properties": {  
"createdDate": {  
"type": "date",  
"index": false  
}  
},  
"dynamic\_templates": [  
{  
"period": {  
"path\_match": "period\..+",  
"match\_mapping\_type": "string",  
"match\_pattern": "regex",  
"mapping": {  
"index": true,  
"type": "keyword"  
}  
}  
},  
{  
"groupingUnit": {  
"path\_match": "groupingUnit\..+",  
"match\_mapping\_type": "string",  
"match\_pattern": "regex",  
"mapping": {  
"fields": {  
"\_search": {  
"search\_analyzer": "simple\_string\_search",  
"analyzer": "simple\_string\_index",  
"type": "text"  
}  
},  
"index": true,  
"type": "keyword"  
}  
}  
},  
{  
"formElement": {  
"path\_match": "formElement\..+",  
"match\_mapping\_type": "string",  
"match\_pattern": "regex",  
"mapping": {  
"index": false,  
"type": "keyword"  
}  
}  
},  
{  
"formName": {  
"path\_match": "formName\..+",  
"match\_mapping\_type": "string",  
"match\_pattern": "regex",  
"mapping": {  
"fields": {  
"\_search": {  
"search\_analyzer": "simple\_string\_search",  
"analyzer": "simple\_string\_index",  
"type": "text"  
}  
},  
"index": true,  
"type": "keyword"  
}  
}  
},  
{  
"document": {  
"path\_match": "document\..+",  
"match\_mapping\_type": "string",  
"match\_pattern": "regex",  
"mapping": {  
"index": true,  
"type": "keyword"  
}  
}  
},  
{  
"groupingUnit": {  
"properties": {  
"identifier": {  
"properties": {  
"type": {  
"type": "keyword",  
"fields": {  
"\_search": {  
"type": "text",  
"analyzer": "simple\_string\_index",  
"search\_analyzer": "simple\_string\_search"  
}  
}  
},  
"value": {  
"type": "keyword",  
"fields": {  
"\_search": {  
"type": "text",  
"analyzer": "simple\_string\_index",  
"search\_analyzer": "simple\_string\_search"  
}  
}  
}  
}  
},  
"name": {  
"type": "keyword",  
"fields": {  
"\_search": {  
"type": "text",  
"analyzer": "simple\_string\_index",  
"search\_analyzer": "simple\_string\_search"  
}  
}  
},  
"role": {  
"type": "keyword",  
"fields": {  
"\_search": {  
"type": "text",  
"analyzer": "simple\_string\_index",  
"search\_analyzer": "simple\_string\_search"  
}  
}  
}  
}  
}  
}  
]  
}

This is the output from a GET \_mapping:

{  
"my\_index": {  
"mappings": {  
"properties": {  
"dynamic\_templates": {  
"properties": {  
"document": {  
"properties": {  
"mapping": {  
"properties": {  
"index": {  
"type": "boolean"  
},  
"type": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
}  
}  
},  
"match\_mapping\_type": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"match\_pattern": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
},  
"path\_match": {  
"type": "text",  
"fields": {  
"keyword": {  
"type": "keyword",  
"ignore\_above": 256  
}  
}  
}  
}  
},

---

<div class="post-metadata">

**Author:** ![lhartzman](https://avatars.discourse-cdn.com/v4/letter/l/d2c977/32.png) [@lhartzman](https://discuss.elastic.co/u/lhartzman)\
**Post date:** [September 4, 2019, 9:57pm UTC](https://discuss.elastic.co/t/newbie-questions-on-mapping/197606/4 "2019-09-04T21:57:13Z")

</div>

Discovered that the issue was related more to a bad mapping. By rebuilding it a piece at a time, I was able to clean things up and the expected response was presented.

Les

---

<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:** [October 2, 2019, 9:57pm UTC](https://discuss.elastic.co/t/newbie-questions-on-mapping/197606/5 "2019-10-02T21:57:19Z")

</div>

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