# Searching across multiple indices vs 2 indices requests on a single indice

**URL:** <https://discuss.elastic.co/t/searching-across-multiple-indices-vs-2-indices-requests-on-a-single-indice/168552>\
**Category:** Elasticsearch\
**Created:** [February 15, 2019, 9:02am UTC](https://discuss.elastic.co/t/searching-across-multiple-indices-vs-2-indices-requests-on-a-single-indice/168552 "2019-02-15T09:02:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![freaka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/freaka/32/41962_2.png) [@freaka](https://discuss.elastic.co/u/freaka)\
**Post date:** [February 15, 2019, 9:02am UTC](https://discuss.elastic.co/t/searching-across-multiple-indices-vs-2-indices-requests-on-a-single-indice/168552/1 "2019-02-15T09:02:51Z")

</div>

Hello,

my data model is centered around a concept that shapes the indices names (for easier filtering on this concept). I have 3 types of indices per concept : start, wip, end. So indices look like that:  
`start-concept-a`, `wip-concept-a`, `end-concept-a` and same goes for `concept-b` and so on.

Now there is one additionnal thing. A document ID is always unique across all indices of the same type (I cannot have `id1` tied to `concept-a` and `concept-b`). This is implemented on the layer above elasticsearch itself (a java api that adds a bit of business logic and simplifies calls to elasticsearch for the end user).

One last important thing, there is a lookup indice to match every document ID against a concept.

Now that I tried to explain my data model, here comes the question:  
What is the most efficient between these 2 ways of getting a list of items by ID stored under the same type of indice (say, indices starting with `start-*`) :

- For each ID in the list, check on what indice it is stored using a GET by ID on the lookup indice, then fetch the document on the proper indice (say, `start-concept-a`).
- make a GET request on `start-*`

I hope I was clear enough, if not, I would be glad to try and explain more clearly.

thanks,

---

<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:** [March 15, 2019, 9:02am UTC](https://discuss.elastic.co/t/searching-across-multiple-indices-vs-2-indices-requests-on-a-single-indice/168552/2 "2019-03-15T09:02:55Z")

</div>

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