# Alias for multiple indexes, why can't I use /indexname/doctype/docno?

**URL:** <https://discuss.elastic.co/t/alias-for-multiple-indexes-why-cant-i-use-indexname-doctype-docno/65588>\
**Category:** Elasticsearch\
**Created:** [November 10, 2016, 6:39am UTC](https://discuss.elastic.co/t/alias-for-multiple-indexes-why-cant-i-use-indexname-doctype-docno/65588 "2016-11-10T06:39:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ankh](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@ankh](https://discuss.elastic.co/u/ankh)\
**Post date:** [November 10, 2016, 6:39am UTC](https://discuss.elastic.co/t/alias-for-multiple-indexes-why-cant-i-use-indexname-doctype-docno/65588/1 "2016-11-10T06:39:28Z")

</div>

We have an alias combining multiple indexes. Searching across the indexes via the alias and the \_search endpoint is fine.

However, when referring to a document by its ID as a URI:

`curl http://the-node:9200/the-alias/doc/123`

we get the error:

`"Alias [the-alias] has more than one indices associated with it [[the-index1, the-index2]], can't execute a single index op"`

I can understand why you can't _index_ via a multi-index alias, but why can't you get a document via a URI?

---

<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:** [November 14, 2016, 1:07am UTC](https://discuss.elastic.co/t/alias-for-multiple-indexes-why-cant-i-use-indexname-doctype-docno/65588/2 "2016-11-14T01:07:32Z")

</div>

How does it know what document to get if there are multiple that match?

---

<div class="post-metadata">

**Author:** ![ankh](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@ankh](https://discuss.elastic.co/u/ankh)\
**Post date:** [November 14, 2016, 1:24am UTC](https://discuss.elastic.co/t/alias-for-multiple-indexes-why-cant-i-use-indexname-doctype-docno/65588/3 "2016-11-14T01:24:12Z")

</div>

That makes sense. The way we're loading the indexes, the ids in one index will not overlap with ids in other indexes, so I didn't consider that.

Whereas, I guess, a search for a particular id will just return multiple documents if the same id was in multiple indexes.

Thanks!

---

<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:** [November 14, 2016, 4:05am UTC](https://discuss.elastic.co/t/alias-for-multiple-indexes-why-cant-i-use-indexname-doctype-docno/65588/4 "2016-11-14T04:05:38Z")

</div>

Yeo GET isn't smart enough to reconcile or provide priority or anything, it's a basic operation designed for a single document 🙂

---

<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:** [December 12, 2016, 4:05am UTC](https://discuss.elastic.co/t/alias-for-multiple-indexes-why-cant-i-use-indexname-doctype-docno/65588/5 "2016-12-12T04:05:59Z")

</div>

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