# Copy\_To an customize field

**URL:** <https://discuss.elastic.co/t/copy-to-an-customize-field/17554>\
**Category:** Elasticsearch\
**Created:** [May 16, 2014, 12:43pm UTC](https://discuss.elastic.co/t/copy-to-an-customize-field/17554 "2014-05-16T12:43:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dionysus1016](https://avatars.discourse-cdn.com/v4/letter/d/e8c25b/32.png) [@Dionysus1016](https://discuss.elastic.co/u/Dionysus1016)\
**Post date:** [May 16, 2014, 12:43pm UTC](https://discuss.elastic.co/t/copy-to-an-customize-field/17554/1 "2014-05-16T12:43:18Z")

</div>

Hi All,  
Can I customize filed name in dynamic template? For example, I have  
fields like "twitter\_title", "twitter\_body","blog\_title","blog\_body" , and  
there could be more fields with format "xxx\_title","xxx\_body" which are  
added from front-end, then I want to map "xxx\_title" and "xxx\_body" to  
"xxx", for example "twitter\_title" to "twitter", are there any way for  
this kind of mapping?

dynamic\_templates" : [  
{  
"string\_template" : {  
"match" : "\*\_title",  
"match\_mapping\_type" : "string",  
"mapping" : {  
"type" : "string",  
"copy\_to" : "target field name" # how  
could I calculate target field name from {name}?  
}

```
       }
     }                                                         
   ]

```

Thanks!  
Jun

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0ab472ee-bac1-4dd0-bbcd-83cd013f0e7e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0ab472ee-bac1-4dd0-bbcd-83cd013f0e7e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [July 6, 2017, 1:28am UTC](https://discuss.elastic.co/t/copy-to-an-customize-field/17554/2 "2017-07-06T01:28:55Z")

</div>


