# (Realtime) GET request and multiple aliases

**URL:** <https://discuss.elastic.co/t/realtime-get-request-and-multiple-aliases/9675>\
**Category:** Elasticsearch\
**Created:** [November 12, 2012, 3:07pm UTC](https://discuss.elastic.co/t/realtime-get-request-and-multiple-aliases/9675 "2012-11-12T15:07:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karussell\_2](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@Karussell\_2](https://discuss.elastic.co/u/Karussell_2)\
**Post date:** [November 12, 2012, 3:07pm UTC](https://discuss.elastic.co/t/realtime-get-request-and-multiple-aliases/9675/1 "2012-11-12T15:07:37Z")

</div>

Hi,

when I try to GET an object via localhost:9200/myindex/mytype/1

but there are multiple indices associated with the alias 'myindex' I get  
{"error":"ElasticSearchIllegalArgumentException[Alias [myindex] has more  
than one index associated with it [[myindex1, myindex2]], can't execute a  
single index op]","status":400}

How would you fix that?

Regards,  
Peter.

--

---

<div class="post-metadata">

**Author:** ![Karussell\_2](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@Karussell\_2](https://discuss.elastic.co/u/Karussell_2)\
**Post date:** [November 12, 2012, 3:10pm UTC](https://discuss.elastic.co/t/realtime-get-request-and-multiple-aliases/9675/2 "2012-11-12T15:10:36Z")

</div>

routing=somehint

should fix it. thought this param is only available for indexing ...

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [November 13, 2012, 2:37am UTC](https://discuss.elastic.co/t/realtime-get-request-and-multiple-aliases/9675/3 "2012-11-13T02:37:24Z")

</div>

In order to perform the get operation, elasticsearch needs to know exact  
shard where the requested record is located. If an alias can be resolved  
into multiple indices, it's not possible to determine which shard the  
record belongs to, even if you specify a routing parameter. So, in order to  
fix that, you need to replace alias with an index or with an alias that  
resolves into a single index.

On Monday, November 12, 2012 10:10:36 AM UTC-5, Karussell wrote:

> routing=somehint
> 
> should fix it. thought this param is only available for indexing ...

--

---

<div class="post-metadata">

**Author:** ![Karussell\_2](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@Karussell\_2](https://discuss.elastic.co/u/Karussell_2)\
**Post date:** [November 13, 2012, 2:03pm UTC](https://discuss.elastic.co/t/realtime-get-request-and-multiple-aliases/9675/4 "2012-11-13T14:03:40Z")

</div>

Ah, ok. thanks for the clarification!

--

---

<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, 3:04am UTC](https://discuss.elastic.co/t/realtime-get-request-and-multiple-aliases/9675/5 "2017-07-06T03:04:33Z")

</div>


