# Copy\_to an dynamic or customised field

**URL:** <https://discuss.elastic.co/t/copy-to-an-dynamic-or-customised-field/157310>\
**Category:** Elasticsearch\
**Created:** [November 19, 2018, 9:12am UTC](https://discuss.elastic.co/t/copy-to-an-dynamic-or-customised-field/157310 "2018-11-19T09:12:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![snak](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@snak](https://discuss.elastic.co/u/snak)\
**Post date:** [November 19, 2018, 9:12am UTC](https://discuss.elastic.co/t/copy-to-an-dynamic-or-customised-field/157310/1 "2018-11-19T09:12:07Z")

</div>

How to configure copy\_to from one dynamic template to another dynamic  
template.

Here is a sample Config: -

```
"dynamic_templates": [{
"template_entity_name_": {
"match": "entity_name_*",
"match_mapping_type": "string",
"mapping": {
"type": "text",
"store": true,
"index": false,
"norms": false,
"index_options": "docs",
"copy_to": ["nameStartsWith", "wordOfNameStartsWith", "all_names",
"all_search_fields_*",
"all_search_fields", "wordOfNameStartsWith_*",
"trigrams_search_fields_*",
"whole_short_name", "whole_word" ]
}
}
}

```

if we try to index entity\_name\_en\_US it should copy to  
all\_search\_fields\_en\_US and if we try for entity\_name\_en\_GB then it should  
copy to all\_search\_fields\_en\_GB.. but its not working..

How can we solve this problem ?

---

<div class="post-metadata">

**Author:** ![sanalkstephen](https://avatars.discourse-cdn.com/v4/letter/s/73ab20/32.png) [@sanalkstephen](https://discuss.elastic.co/u/sanalkstephen)\
**Post date:** [November 19, 2018, 9:17am UTC](https://discuss.elastic.co/t/copy-to-an-dynamic-or-customised-field/157310/2 "2018-11-19T09:17:14Z")

</div>

> [@snak](#):
>
> dynamic

Hi  
Even I have faced the same issue.. When we were working with solr we could do something like this

`<copyField source="name_*" dest="all_search_fields_* />`

But could not find an equivalent in Elasticsearch.

---

<div class="post-metadata">

**Author:** ![nkatiyar](https://avatars.discourse-cdn.com/v4/letter/n/85f322/32.png) [@nkatiyar](https://discuss.elastic.co/u/nkatiyar)\
**Post date:** [November 19, 2018, 9:23am UTC](https://discuss.elastic.co/t/copy-to-an-dynamic-or-customised-field/157310/3 "2018-11-19T09:23:21Z")

</div>

I am also facing same issue. Please let me know if you find the resolution.

---

<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:** [December 17, 2018, 9:23am UTC](https://discuss.elastic.co/t/copy-to-an-dynamic-or-customised-field/157310/4 "2018-12-17T09:23:30Z")

</div>

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