# Illegal combination of \[copy\_to\] and \[nested\] mappings: \[copy\_to\]

**URL:** https://discuss.elastic.co/t/illegal-combination-of-copy-to-and-nested-mappings-copy-to/140690
**Category:** Elasticsearch
**Created:** [July 19, 2018, 8:31am UTC](https://discuss.elastic.co/t/illegal-combination-of-copy-to-and-nested-mappings-copy-to/140690 "2018-07-19T08:31:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Syed\_ali\_abbas\_shah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/syed_ali_abbas_shah/32/30053_2.png) [@Syed\_ali\_abbas\_shah](https://discuss.elastic.co/u/Syed_ali_abbas_shah)
#### Post date: [July 19, 2018, 8:31am UTC](https://discuss.elastic.co/t/illegal-combination-of-copy-to-and-nested-mappings-copy-to/140690/1 "2018-07-19T08:31:15Z")

</div>

I am facing an error for following mapping and my version is current 6.3

{  
"error": {  
"root\_cause": [  
{  
"type": "illegal\_argument\_exception",  
"reason": "Illegal combination of [copy\_to] and [nested] mappings: [copy\_to] may only copy data to the current nested document or any of its parents, however one [copy\_to] directive is trying to copy data from nested object [null] to [teams]"  
}  
],  
"type": "illegal\_argument\_exception",  
"reason": "Illegal combination of [copy\_to] and [nested] mappings: [copy\_to] may only copy data to the current nested document or any of its parents, however one [copy\_to] directive is trying to copy data from nested object [null] to [teams]"  
},  
"status": 400  
}

``PUT twitter/\_mapping/doc/  
{  
"properties": {  
"priority": {  
"type": "integer",  
"copy\_to": "teams.priority"  
},  
"teams": {  
"type": "nested",  
"properties":{  
"id": {  
"type": "integer",  
"index": true  
},  
"priority": {  
"type": "integer",  
"index": true  
}  
}  
}  
}  
}

``

---

<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: [August 16, 2018, 8:31am UTC](https://discuss.elastic.co/t/illegal-combination-of-copy-to-and-nested-mappings-copy-to/140690/2 "2018-08-16T08:31:19Z")

</div>

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