# Map elasticsearch field to different field

**URL:** <https://discuss.elastic.co/t/map-elasticsearch-field-to-different-field/213799>\
**Category:** Elasticsearch\
**Created:** [January 5, 2020, 12:13pm UTC](https://discuss.elastic.co/t/map-elasticsearch-field-to-different-field/213799 "2020-01-05T12:13:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jlevym](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jlevym/32/59383_2.png) [@jlevym](https://discuss.elastic.co/u/jlevym)\
**Post date:** [January 5, 2020, 12:13pm UTC](https://discuss.elastic.co/t/map-elasticsearch-field-to-different-field/213799/1 "2020-01-05T12:13:55Z")

</div>

I am using two indexes.The first, called lessons1 has a userId field:

> `userId : < id number>`

The second is called users1 and has a userName field:

> ` userName: <user name>`

and a userId field,

> `userId: <id number>`

When running a query on lessons1, I would like to return the userName intead of the userId.  
I have tried to do this by creating a combined index called \*1 and do definitions in logstash, but have not succeeded. Could you please help me find a solution.

---

<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:** [February 2, 2020, 12:14pm UTC](https://discuss.elastic.co/t/map-elasticsearch-field-to-different-field/213799/2 "2020-02-02T12:14:02Z")

</div>

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