# Copy\_to not working

**URL:** <https://discuss.elastic.co/t/copy-to-not-working/23211>\
**Category:** Elasticsearch\
**Created:** [April 13, 2015, 3:02pm UTC](https://discuss.elastic.co/t/copy-to-not-working/23211 "2015-04-13T15:02:16Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jaraxal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaraxal/32/458_2.png) [@Jaraxal](https://discuss.elastic.co/u/Jaraxal)\
**Post date:** [April 13, 2015, 3:02pm UTC](https://discuss.elastic.co/t/copy-to-not-working/23211/1 "2015-04-13T15:02:16Z")

</div>

I'm having issues getting the "copy\_to" functionality to work. It seems  
pretty straight forward, so I wasn't expecting any problems.

Here is my index creation call:

curl -XPUT [http://esnode:9200/test\_index](http://esnode:9200/test_index) -d '{  
"settings" : {  
"number\_of\_shards" : 1,  
"number\_of\_replicas" : 1,  
"index.mapping.ignore\_malformed" : true  
},  
"mappings" : {  
"default" : {  
"properties": {  
"name" : {  
"type" : "string",  
"copy\_to" : "name\_phonetic"  
},  
"name\_phonetic" : {  
"type" : "string"  
}  
}  
}  
}  
}'

curl -XPUT [http://esnode:9200/test\_index/default/1](http://esnode:9200/test_index/default/1) -d '{  
"name" : "smith"  
}'

When I query against test\_index/default, I can see that "smith" is in the  
"name" field. However the "name\_phonetic" field is blank. What am I  
missing?

Thank you!

--  
Michael

--  
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/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 13, 2015, 3:23pm UTC](https://discuss.elastic.co/t/copy-to-not-working/23211/2 "2015-04-13T15:23:50Z")

</div>

Nothing.

Elasticsearch does not modify \_source field which contains the document you sent.  
It does create in the inverted index a new field. You can use it to query, compute or retrieve if you stored it.

--  
David Pilato - Developer | Evangelist

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co/)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

@dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)

> Le 13 avr. 2015 à 17:02, Michael Young [michael.l.young@gmail.com](mailto:michael.l.young@gmail.com) a écrit :
> 
> I'm having issues getting the "copy\_to" functionality to work. It seems pretty straight forward, so I wasn't expecting any problems.
> 
> Here is my index creation call:
> 
> curl -XPUT [http://esnode:9200/test\_index](http://esnode:9200/test_index) [http://esnode:9200/test\_index](http://esnode:9200/test_index) -d '{  
> "settings" : {  
> "number\_of\_shards" : 1,  
> "number\_of\_replicas" : 1,  
> "index.mapping.ignore\_malformed" : true  
> },  
> "mappings" : {  
> "default" : {  
> "properties": {  
> "name" : {  
> "type" : "string",  
> "copy\_to" : "name\_phonetic"  
> },  
> "name\_phonetic" : {  
> "type" : "string"  
> }  
> }  
> }  
> }  
> }'
> 
> curl -XPUT [http://esnode:9200/test\_index/default/1](http://esnode:9200/test_index/default/1) [http://esnode:9200/test\_index/default/1](http://esnode:9200/test_index/default/1) -d '{  
> "name" : "smith"  
> }'
> 
> When I query against test\_index/default, I can see that "smith" is in the "name" field. However the "name\_phonetic" field is blank. What am I missing?
> 
> Thank you!
> 
> --  
> Michael
> 
> --  
> 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) [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com) [https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout) [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 13, 2015, 3:39pm UTC](https://discuss.elastic.co/t/copy-to-not-working/23211/3 "2015-04-13T15:39:04Z")

</div>

I want to expand on this a bit - both copy\_to and transform only modify the  
_indexed_ document, not the source document. The thinking is that you can  
modify the source document yourself in the source application but the  
source application _can't_ modify the indexed document without modifying  
the source document. Copy\_to is useful for playing tricks like  
concatenating multiple fields together so you only have to search on one of  
them at a time rather than all of them.

For what it looks like you are doing I suggest using nested fields:

> **[Multi-fields | Elasticsearch Guide \[1.3\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/1.3/_multi_fields.html)**

Nik

On Mon, Apr 13, 2015 at 11:23 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Nothing.
> 
> Elasticsearch does not modify \_source field which contains the document  
> you sent.  
> It does create in the inverted index a new field. You can use it to query,  
> compute or retrieve if you stored it.
> 
> --  
> _David Pilato_ - Developer | Evangelist  
> _[elastic.co](http://elastic.co) [http://elastic.co](http://elastic.co)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 13 avr. 2015 à 17:02, Michael Young [michael.l.young@gmail.com](mailto:michael.l.young@gmail.com) a  
> écrit :
> 
> I'm having issues getting the "copy\_to" functionality to work. It seems  
> pretty straight forward, so I wasn't expecting any problems.
> 
> Here is my index creation call:
> 
> curl -XPUT [http://esnode:9200/test\_index](http://esnode:9200/test_index) -d '{  
> "settings" : {  
> "number\_of\_shards" : 1,  
> "number\_of\_replicas" : 1,  
> "index.mapping.ignore\_malformed" : true  
> },  
> "mappings" : {  
> "default" : {  
> "properties": {  
> "name" : {  
> "type" : "string",  
> "copy\_to" : "name\_phonetic"  
> },  
> "name\_phonetic" : {  
> "type" : "string"  
> }  
> }  
> }  
> }  
> }'
> 
> curl -XPUT [http://esnode:9200/test\_index/default/1](http://esnode:9200/test_index/default/1) -d '{  
> "name" : "smith"  
> }'
> 
> When I query against test\_index/default, I can see that "smith" is in the  
> "name" field. However the "name\_phonetic" field is blank. What am I  
> missing?
> 
> Thank you!
> 
> --  
> Michael
> 
> --  
> 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/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr)  
> [https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAPmjWd2RiS0c4\_yRZontn%2BsRgfj52GeYw8-cP7OC\_LeYiDwiZw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2RiS0c4_yRZontn%2BsRgfj52GeYw8-cP7OC_LeYiDwiZw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jaraxal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaraxal/32/458_2.png) [@Jaraxal](https://discuss.elastic.co/u/Jaraxal)\
**Post date:** [April 13, 2015, 4:31pm UTC](https://discuss.elastic.co/t/copy-to-not-working/23211/4 "2015-04-13T16:31:17Z")

</div>

Nikolas,

Thank you for the response. This is definitely helpful and answers my  
question. Nested fields looks to solve what I'm trying to do for this  
particular use case; using nest fields for name variations will work  
perfectly.

For other use cases, such as creating a title to the record/document based  
on 2 or more fields, that doesn't work. The copy\_to and transform  
functionality will allow me to make a "title" field searchable, but not  
necessarily viewable. It looks like I'll be forced to do that outside of  
Elasticsearch. This was something I was easily able to do with Solr, so I  
anticipated a similar capability.

## Thanks again!

Michael

On Mon, Apr 13, 2015 at 11:39 AM, Nikolas Everett [nik9000@gmail.com](mailto:nik9000@gmail.com) wrote:

> I want to expand on this a bit - both copy\_to and transform only modify  
> the _indexed_ document, not the source document. The thinking is that you  
> can modify the source document yourself in the source application but the  
> source application _can't_ modify the indexed document without modifying  
> the source document. Copy\_to is useful for playing tricks like  
> concatenating multiple fields together so you only have to search on one of  
> them at a time rather than all of them.
> 
> For what it looks like you are doing I suggest using nested fields:  
> [Multi-fields | Elasticsearch Guide [1.3] | Elastic](http://www.elastic.co/guide/en/elasticsearch/reference/1.3/_multi_fields.html)
> 
> Nik
> 
> On Mon, Apr 13, 2015 at 11:23 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > Nothing.
> > 
> > Elasticsearch does not modify \_source field which contains the document  
> > you sent.  
> > It does create in the inverted index a new field. You can use it to  
> > query, compute or retrieve if you stored it.
> > 
> > --  
> > _David Pilato_ - Developer | Evangelist  
> > _[elastic.co](http://elastic.co) [http://elastic.co](http://elastic.co)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> > [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 13 avr. 2015 à 17:02, Michael Young [michael.l.young@gmail.com](mailto:michael.l.young@gmail.com) a  
> > écrit :
> > 
> > I'm having issues getting the "copy\_to" functionality to work. It seems  
> > pretty straight forward, so I wasn't expecting any problems.
> > 
> > Here is my index creation call:
> > 
> > curl -XPUT [http://esnode:9200/test\_index](http://esnode:9200/test_index) -d '{  
> > "settings" : {  
> > "number\_of\_shards" : 1,  
> > "number\_of\_replicas" : 1,  
> > "index.mapping.ignore\_malformed" : true  
> > },  
> > "mappings" : {  
> > "default" : {  
> > "properties": {  
> > "name" : {  
> > "type" : "string",  
> > "copy\_to" : "name\_phonetic"  
> > },  
> > "name\_phonetic" : {  
> > "type" : "string"  
> > }  
> > }  
> > }  
> > }  
> > }'
> > 
> > curl -XPUT [http://esnode:9200/test\_index/default/1](http://esnode:9200/test_index/default/1) -d '{  
> > "name" : "smith"  
> > }'
> > 
> > When I query against test\_index/default, I can see that "smith" is in the  
> > "name" field. However the "name\_phonetic" field is blank. What am I  
> > missing?
> > 
> > Thank you!
> > 
> > --  
> > Michael
> > 
> > --  
> > 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/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr)  
> > [https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/NsWQPF74i5Q/unsubscribe](https://groups.google.com/d/topic/elasticsearch/NsWQPF74i5Q/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/CAPmjWd2RiS0c4\_yRZontn%2BsRgfj52GeYw8-cP7OC\_LeYiDwiZw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2RiS0c4_yRZontn%2BsRgfj52GeYw8-cP7OC_LeYiDwiZw%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2RiS0c4\_yRZontn%2BsRgfj52GeYw8-cP7OC\_LeYiDwiZw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd2RiS0c4_yRZontn%2BsRgfj52GeYw8-cP7OC_LeYiDwiZw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CA%2B6%3DytXSgTdcDPE0\_Opwriza8VO53KtTWUEdJkmjDMgSv3xw0w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2B6%3DytXSgTdcDPE0_Opwriza8VO53KtTWUEdJkmjDMgSv3xw0w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jaraxal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaraxal/32/458_2.png) [@Jaraxal](https://discuss.elastic.co/u/Jaraxal)\
**Post date:** [April 13, 2015, 4:39pm UTC](https://discuss.elastic.co/t/copy-to-not-working/23211/5 "2015-04-13T16:39:54Z")

</div>

So if I use "stored" : true with the field definition, then it would be  
possible to fetch that field for display purposes?

--  
Michael

On Mon, Apr 13, 2015 at 11:23 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:

> Nothing.
> 
> Elasticsearch does not modify \_source field which contains the document  
> you sent.  
> It does create in the inverted index a new field. You can use it to query,  
> compute or retrieve if you stored it.
> 
> --  
> _David Pilato_ - Developer | Evangelist  
> _[elastic.co](http://elastic.co) [http://elastic.co](http://elastic.co)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> 
> Le 13 avr. 2015 à 17:02, Michael Young [michael.l.young@gmail.com](mailto:michael.l.young@gmail.com) a  
> écrit :
> 
> I'm having issues getting the "copy\_to" functionality to work. It seems  
> pretty straight forward, so I wasn't expecting any problems.
> 
> Here is my index creation call:
> 
> curl -XPUT [http://esnode:9200/test\_index](http://esnode:9200/test_index) -d '{  
> "settings" : {  
> "number\_of\_shards" : 1,  
> "number\_of\_replicas" : 1,  
> "index.mapping.ignore\_malformed" : true  
> },  
> "mappings" : {  
> "default" : {  
> "properties": {  
> "name" : {  
> "type" : "string",  
> "copy\_to" : "name\_phonetic"  
> },  
> "name\_phonetic" : {  
> "type" : "string"  
> }  
> }  
> }  
> }  
> }'
> 
> curl -XPUT [http://esnode:9200/test\_index/default/1](http://esnode:9200/test_index/default/1) -d '{  
> "name" : "smith"  
> }'
> 
> When I query against test\_index/default, I can see that "smith" is in the  
> "name" field. However the "name\_phonetic" field is blank. What am I  
> missing?
> 
> Thank you!
> 
> --  
> Michael
> 
> --  
> 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/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/NsWQPF74i5Q/unsubscribe](https://groups.google.com/d/topic/elasticsearch/NsWQPF74i5Q/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr)  
> [https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CA%2B6%3DytW1eiZoCQK%2BzjWSeHbKiVHaVtO7Yrgu4fwGZMekkizaoQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2B6%3DytW1eiZoCQK%2BzjWSeHbKiVHaVtO7Yrgu4fwGZMekkizaoQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 13, 2015, 4:59pm UTC](https://discuss.elastic.co/t/copy-to-not-working/23211/6 "2015-04-13T16:59:49Z")

</div>

Yes _but_ its generally better to do those transforms on the source  
application. The idea is that you'll often want to return multiple things  
from the source so loading the whole thing is usually better than loading a  
bunch of stored fields.

If your looking for the minimal possible amount of work to port from solr  
to elasticsearch then go ahead but if you are looking to do whats more  
normal for Elasticsearch applications then transform in the source  
application.

Nik

On Mon, Apr 13, 2015 at 12:39 PM, Michael Young [michael.l.young@gmail.com](mailto:michael.l.young@gmail.com)  
wrote:

> So if I use "stored" : true with the field definition, then it would be  
> possible to fetch that field for display purposes?
> 
> --  
> Michael
> 
> On Mon, Apr 13, 2015 at 11:23 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> 
> > Nothing.
> > 
> > Elasticsearch does not modify \_source field which contains the document  
> > you sent.  
> > It does create in the inverted index a new field. You can use it to  
> > query, compute or retrieve if you stored it.
> > 
> > --  
> > _David Pilato_ - Developer | Evangelist  
> > _[elastic.co](http://elastic.co) [http://elastic.co](http://elastic.co)_  
> > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> > [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > 
> > Le 13 avr. 2015 à 17:02, Michael Young [michael.l.young@gmail.com](mailto:michael.l.young@gmail.com) a  
> > écrit :
> > 
> > I'm having issues getting the "copy\_to" functionality to work. It seems  
> > pretty straight forward, so I wasn't expecting any problems.
> > 
> > Here is my index creation call:
> > 
> > curl -XPUT [http://esnode:9200/test\_index](http://esnode:9200/test_index) -d '{  
> > "settings" : {  
> > "number\_of\_shards" : 1,  
> > "number\_of\_replicas" : 1,  
> > "index.mapping.ignore\_malformed" : true  
> > },  
> > "mappings" : {  
> > "default" : {  
> > "properties": {  
> > "name" : {  
> > "type" : "string",  
> > "copy\_to" : "name\_phonetic"  
> > },  
> > "name\_phonetic" : {  
> > "type" : "string"  
> > }  
> > }  
> > }  
> > }  
> > }'
> > 
> > curl -XPUT [http://esnode:9200/test\_index/default/1](http://esnode:9200/test_index/default/1) -d '{  
> > "name" : "smith"  
> > }'
> > 
> > When I query against test\_index/default, I can see that "smith" is in the  
> > "name" field. However the "name\_phonetic" field is blank. What am I  
> > missing?
> > 
> > Thank you!
> > 
> > --  
> > Michael
> > 
> > --  
> > 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/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/NsWQPF74i5Q/unsubscribe](https://groups.google.com/d/topic/elasticsearch/NsWQPF74i5Q/unsubscribe).  
> > To unsubscribe from this group and all its topics, 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/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr)  
> > [https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> 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/CA%2B6%3DytW1eiZoCQK%2BzjWSeHbKiVHaVtO7Yrgu4fwGZMekkizaoQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2B6%3DytW1eiZoCQK%2BzjWSeHbKiVHaVtO7Yrgu4fwGZMekkizaoQ%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CA%2B6%3DytW1eiZoCQK%2BzjWSeHbKiVHaVtO7Yrgu4fwGZMekkizaoQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CA%2B6%3DytW1eiZoCQK%2BzjWSeHbKiVHaVtO7Yrgu4fwGZMekkizaoQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CAPmjWd3Sr3FkV%3DOMy-1koQBnnFnWmbcAusbK9ph0ttvHi8TV4A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3Sr3FkV%3DOMy-1koQBnnFnWmbcAusbK9ph0ttvHi8TV4A%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jaraxal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jaraxal/32/458_2.png) [@Jaraxal](https://discuss.elastic.co/u/Jaraxal)\
**Post date:** [April 13, 2015, 5:24pm UTC](https://discuss.elastic.co/t/copy-to-not-working/23211/7 "2015-04-13T17:24:33Z")

</div>

Thank you Nikolas!

--  
Michael

On Mon, Apr 13, 2015 at 12:59 PM, Nikolas Everett [nik9000@gmail.com](mailto:nik9000@gmail.com) wrote:

> Yes _but_ its generally better to do those transforms on the source  
> application. The idea is that you'll often want to return multiple things  
> from the source so loading the whole thing is usually better than loading a  
> bunch of stored fields.
> 
> If your looking for the minimal possible amount of work to port from solr  
> to elasticsearch then go ahead but if you are looking to do whats more  
> normal for Elasticsearch applications then transform in the source  
> application.
> 
> Nik
> 
> On Mon, Apr 13, 2015 at 12:39 PM, Michael Young \<[michael.l.young@gmail.com](mailto:michael.l.young@gmail.com)
> 
> > wrote:
> 
> > So if I use "stored" : true with the field definition, then it would be  
> > possible to fetch that field for display purposes?
> > 
> > --  
> > Michael
> > 
> > On Mon, Apr 13, 2015 at 11:23 AM, David Pilato [david@pilato.fr](mailto:david@pilato.fr) wrote:
> > 
> > > Nothing.
> > > 
> > > Elasticsearch does not modify \_source field which contains the document  
> > > you sent.  
> > > It does create in the inverted index a new field. You can use it to  
> > > query, compute or retrieve if you stored it.
> > > 
> > > --  
> > > _David Pilato_ - Developer | Evangelist  
> > > _[elastic.co](http://elastic.co) [http://elastic.co](http://elastic.co)_  
> > > @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> > > [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr) | @scrutmydocs  
> > > [https://twitter.com/scrutmydocs](https://twitter.com/scrutmydocs)
> > > 
> > > Le 13 avr. 2015 à 17:02, Michael Young [michael.l.young@gmail.com](mailto:michael.l.young@gmail.com) a  
> > > écrit :
> > > 
> > > I'm having issues getting the "copy\_to" functionality to work. It seems  
> > > pretty straight forward, so I wasn't expecting any problems.
> > > 
> > > Here is my index creation call:
> > > 
> > > curl -XPUT [http://esnode:9200/test\_index](http://esnode:9200/test_index) -d '{  
> > > "settings" : {  
> > > "number\_of\_shards" : 1,  
> > > "number\_of\_replicas" : 1,  
> > > "index.mapping.ignore\_malformed" : true  
> > > },  
> > > "mappings" : {  
> > > "default" : {  
> > > "properties": {  
> > > "name" : {  
> > > "type" : "string",  
> > > "copy\_to" : "name\_phonetic"  
> > > },  
> > > "name\_phonetic" : {  
> > > "type" : "string"  
> > > }  
> > > }  
> > > }  
> > > }  
> > > }'
> > > 
> > > curl -XPUT [http://esnode:9200/test\_index/default/1](http://esnode:9200/test_index/default/1) -d '{  
> > > "name" : "smith"  
> > > }'
> > > 
> > > When I query against test\_index/default, I can see that "smith" is in  
> > > the "name" field. However the "name\_phonetic" field is blank. What am I  
> > > missing?
> > > 
> > > Thank you!
> > > 
> > > --  
> > > Michael
> > > 
> > > --  
> > > 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/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/0570abbe-f894-4822-b89a-3168f5f70687%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to a topic in the  
> > > Google Groups "elasticsearch" group.  
> > > To unsubscribe from this topic, visit  
> > > [https://groups.google.com/d/topic/elasticsearch/NsWQPF74i5Q/unsubscribe](https://groups.google.com/d/topic/elasticsearch/NsWQPF74i5Q/unsubscribe).  
> > > To unsubscribe from this group and all its topics, 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/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr)  
> > > [https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/19DF140F-CB24-4C61-BE7A-8A7A88D0045D%40pilato.fr?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > 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/CA%2B6%3DytW1eiZoCQK%2BzjWSeHbKiVHaVtO7Yrgu4fwGZMekkizaoQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2B6%3DytW1eiZoCQK%2BzjWSeHbKiVHaVtO7Yrgu4fwGZMekkizaoQ%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CA%2B6%3DytW1eiZoCQK%2BzjWSeHbKiVHaVtO7Yrgu4fwGZMekkizaoQ%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CA%2B6%3DytW1eiZoCQK%2BzjWSeHbKiVHaVtO7Yrgu4fwGZMekkizaoQ%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/NsWQPF74i5Q/unsubscribe](https://groups.google.com/d/topic/elasticsearch/NsWQPF74i5Q/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/CAPmjWd3Sr3FkV%3DOMy-1koQBnnFnWmbcAusbK9ph0ttvHi8TV4A%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3Sr3FkV%3DOMy-1koQBnnFnWmbcAusbK9ph0ttvHi8TV4A%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3Sr3FkV%3DOMy-1koQBnnFnWmbcAusbK9ph0ttvHi8TV4A%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd3Sr3FkV%3DOMy-1koQBnnFnWmbcAusbK9ph0ttvHi8TV4A%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/CA%2B6%3DytWQuNKVkM2k1OvbZ8neOwiBw9d%2B%2BQ1asLtOcq28c36niQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CA%2B6%3DytWQuNKVkM2k1OvbZ8neOwiBw9d%2B%2BQ1asLtOcq28c36niQ%40mail.gmail.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, 12:20am UTC](https://discuss.elastic.co/t/copy-to-not-working/23211/8 "2017-07-06T00:20:02Z")

</div>


