# Copy To: Order and Whitespace Separation

**URL:** <https://discuss.elastic.co/t/copy-to-order-and-whitespace-separation/27202>\
**Category:** Elasticsearch\
**Created:** [August 11, 2015, 4:22pm UTC](https://discuss.elastic.co/t/copy-to-order-and-whitespace-separation/27202 "2015-08-11T16:22:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![drjz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drjz/32/972_2.png) [@drjz](https://discuss.elastic.co/u/drjz)\
**Post date:** [August 11, 2015, 4:22pm UTC](https://discuss.elastic.co/t/copy-to-order-and-whitespace-separation/27202/1 "2015-08-11T16:22:35Z")

</div>

I have 2 fields: FirstName and SurName, which I want to concatenate during index time by a single whitespace. I wonder whether it is possible to merge the value of both fields to a single field with Elasticsearch? Or does this need to be merged before indexing by some kind of preprocessor?

---

<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:** [August 11, 2015, 4:37pm UTC](https://discuss.elastic.co/t/copy-to-order-and-whitespace-separation/27202/2 "2015-08-11T16:37:20Z")

</div>

`copy_to` is really best for if you don't want the thing in your `_source` field. It sounds like you want to index them together so it'd be better to merge them in the `_source` you submit.

Just thinking about it, I'd advise you to toss the concept of first name and surname because not all folks _have_ first names. Some people have only one name and some people's first names are actually their family names and their second name is their given name. Names are hard regardless of elasticsearch.

---

<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 5, 2017, 11:56pm UTC](https://discuss.elastic.co/t/copy-to-order-and-whitespace-separation/27202/3 "2017-07-05T23:56:26Z")

</div>


