# Any possibility to have es.resource with alias name

**URL:** <https://discuss.elastic.co/t/any-possibility-to-have-es-resource-with-alias-name/115123>\
**Category:** Elasticsearch\
**Tags:** es-hadoop\
**Created:** [January 11, 2018, 3:44pm UTC](https://discuss.elastic.co/t/any-possibility-to-have-es-resource-with-alias-name/115123 "2018-01-11T15:44:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dearsaran](https://avatars.discourse-cdn.com/v4/letter/d/f04885/32.png) [@dearsaran](https://discuss.elastic.co/u/dearsaran)\
**Post date:** [January 11, 2018, 3:44pm UTC](https://discuss.elastic.co/t/any-possibility-to-have-es-resource-with-alias-name/115123/1 "2018-01-11T15:44:26Z")

</div>

Hi All,  
Is there any way I can user Alias name in es.resource while creating EXTERNAL table in HIVE using TBLPROPERTIES.  
I've 2 different indexes in Elasticsearch and alias will be switched between stage and active index.  
So based on alias pointed I want data to be loaded to that specific Index.

---

<div class="post-metadata">

**Author:** ![james.baiera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james.baiera/32/10209_2.png) [@james.baiera](https://discuss.elastic.co/u/james.baiera)\
**Post date:** [January 18, 2018, 7:25pm UTC](https://discuss.elastic.co/t/any-possibility-to-have-es-resource-with-alias-name/115123/2 "2018-01-18T19:25:05Z")

</div>

I don't see why you wouldn't be able to use aliases when creating a table. That said, is there anything that keeps you from just creating two table definitions and loading to the specific indices explicitly by table name instead? Do note that Hive reads and writes the data to ES as requested, so the extra table should have minimal overhead.

---

<div class="post-metadata">

**Author:** ![Dante](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@Dante](https://discuss.elastic.co/u/Dante)\
**Post date:** [January 19, 2018, 4:05am UTC](https://discuss.elastic.co/t/any-possibility-to-have-es-resource-with-alias-name/115123/3 "2018-01-19T04:05:28Z")

</div>

Actually I created hive table with both alias index and actual index. We can get data from both hive tables.

But \_type must be set. (es vesion is 2.4.5)

---

<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 16, 2018, 4:05am UTC](https://discuss.elastic.co/t/any-possibility-to-have-es-resource-with-alias-name/115123/4 "2018-02-16T04:05:44Z")

</div>

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