# Unable to index data to Elasticsearch 7.2 after adding custom template

**URL:** <https://discuss.elastic.co/t/unable-to-index-data-to-elasticsearch-7-2-after-adding-custom-template/197423>\
**Category:** Elasticsearch\
**Created:** [August 29, 2019, 11:08pm UTC](https://discuss.elastic.co/t/unable-to-index-data-to-elasticsearch-7-2-after-adding-custom-template/197423 "2019-08-29T23:08:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![estack](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/estack/32/53331_2.png) [@estack](https://discuss.elastic.co/u/estack)\
**Post date:** [August 29, 2019, 11:08pm UTC](https://discuss.elastic.co/t/unable-to-index-data-to-elasticsearch-7-2-after-adding-custom-template/197423/1 "2019-08-29T23:08:46Z")

</div>

I am trying to index data to elastic. Indexing does not happen when I have a mapping for 'uid' as keyword. But it works when there are no custom mappings defined for 7.2 version. Please help.

Below is the custom template:

curl -X PUT "localhost:9200/\_template/template\_fortest" -H 'Content-Type: application/json' -d'  
{  
"index\_patterns": "math\*",  
"settings": {  
"number\_of\_shards": 2  
},  
"order" : -4,  
"mappings": {  
"properties": {  
"uid": {  
"type": "keyword"  
}  
}  
}  
}  
'

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [August 30, 2019, 8:35am UTC](https://discuss.elastic.co/t/unable-to-index-data-to-elasticsearch-7-2-after-adding-custom-template/197423/2 "2019-08-30T08:35:14Z")

</div>

Hey,

can you share a **full** reproduction including error messages? What happens when a document is indexed, what exception is returned?

Also, please specify the full version of the stack you are using and take your time to properly format your code snippets, as this is super to read. This forum supports markdown.

--Alex

---

<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:** [September 27, 2019, 8:35am UTC](https://discuss.elastic.co/t/unable-to-index-data-to-elasticsearch-7-2-after-adding-custom-template/197423/3 "2019-09-27T08:35:25Z")

</div>

Closed on September 27, 2019, 8:35am UTC

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