# Elasticsearch Aliasing a field during search

**URL:** <https://discuss.elastic.co/t/elasticsearch-aliasing-a-field-during-search/136025>\
**Category:** Elasticsearch\
**Created:** [June 15, 2018, 3:55am UTC](https://discuss.elastic.co/t/elasticsearch-aliasing-a-field-during-search/136025 "2018-06-15T03:55:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saiprasad\_Krishnamur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saiprasad_krishnamur/32/32290_2.png) [@Saiprasad\_Krishnamur](https://discuss.elastic.co/u/Saiprasad_Krishnamur)\
**Post date:** [June 15, 2018, 3:55am UTC](https://discuss.elastic.co/t/elasticsearch-aliasing-a-field-during-search/136025/1 "2018-06-15T03:55:55Z")

</div>

0  
down vote  
favorite  
1  
Using Elasticsearch v 5.X.

Jumped into a rather strange requirement and need ideas on approach here. I've got a legacy index with fields F1, F2, F3 (Just for illustration purposes). I want to remove the field F2 and F3 from the mapping as they represent the same value as F1. I'm doing this to avoid duplicates and save some space.

But the issue I have is on the existing APPS that are searching this index. These APPs are ones that we don't manage. They still continue to use F2 and F3 as part of their search requests.

Is there any approach where I could transparently do this perhaps like field aliasing (or field synonyms) during search (ie if someone searches for F2 and F3, I'd instead search on F1).

The challenge here is that I'd want to do this in a transparent way without affecting my search APPs(clients). Ideas?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 15, 2018, 4:17am UTC](https://discuss.elastic.co/t/elasticsearch-aliasing-a-field-during-search/136025/2 "2018-06-15T04:17:50Z")

</div>

There's work coming that will allow this, but nothing for the moment unfortunately.

---

<div class="post-metadata">

**Author:** ![Saiprasad\_Krishnamur](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saiprasad_krishnamur/32/32290_2.png) [@Saiprasad\_Krishnamur](https://discuss.elastic.co/u/Saiprasad_Krishnamur)\
**Post date:** [June 15, 2018, 7:43am UTC](https://discuss.elastic.co/t/elasticsearch-aliasing-a-field-during-search/136025/3 "2018-06-15T07:43:07Z")

</div>

> [@Saiprasad\_Krishnamur](#):
>
> Jumped into a rather strange requirement and need ideas on approach here. I've got a legacy index with fields F1, F2, F3 (Just for illustration purposes). I want to remove the field F2 and F3 from the mapping as they represent the same value as F1. I'm doing this to avoid duplicates and save some space.

Ok - any plan on the timeline and the release?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 15, 2018, 9:03pm UTC](https://discuss.elastic.co/t/elasticsearch-aliasing-a-field-during-search/136025/4 "2018-06-15T21:03:10Z")

</div>

Follow [https://github.com/elastic/elasticsearch/pull/31287](https://github.com/elastic/elasticsearch/pull/31287) for more info.

---

<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 13, 2018, 9:03pm UTC](https://discuss.elastic.co/t/elasticsearch-aliasing-a-field-during-search/136025/5 "2018-07-13T21:03:12Z")

</div>

Closed on July 13, 2018, 9:03pm UTC

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