# Multi-tenancy

**URL:** <https://discuss.elastic.co/t/multi-tenancy/6058>\
**Category:** Elasticsearch\
**Created:** [December 2, 2011, 7:56pm UTC](https://discuss.elastic.co/t/multi-tenancy/6058 "2011-12-02T19:56:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![michaelgeis](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@michaelgeis](https://discuss.elastic.co/u/michaelgeis)\
**Post date:** [December 2, 2011, 7:56pm UTC](https://discuss.elastic.co/t/multi-tenancy/6058/1 "2011-12-02T19:56:51Z")

</div>

Hi,  
I have difficulty finding documentation on how to apply multi-tenancy  
to different types of objects in different indices.

I am familiar with searching multiple types in a single index, search  
the video and article types in the media index:  
curl -XGET [http://localhost:9200/media/image,article/\_search?q=](http://localhost:9200/media/image,article/_search?q=)

The multi-tenancy section on [elasticsearch.org](http://elasticsearch.org) demonstrates searching  
for objects of a single type across indices:  
curl -XGET [http://localhost:9200/kimchy,elasticsearch/tweet/\_search?q=tag:warcraft](http://localhost:9200/kimchy,elasticsearch/tweet/_search?q=tag:warcraft)

Is there a way to combine the two, i.e. search for multiple types  
across multiple indices?

Given indices on localhost:9200/videos/video and localhost:9200/media  
above, I'd like to be able to specify which types in those two indices  
I want to cover in a single search. E.g. get article from media and  
video in videos, but omit image in media.

---

<div class="post-metadata">

**Author:** ![michaelgeis](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@michaelgeis](https://discuss.elastic.co/u/michaelgeis)\
**Post date:** [December 2, 2011, 9:31pm UTC](https://discuss.elastic.co/t/multi-tenancy/6058/2 "2011-12-02T21:31:37Z")

</div>

I guess I found my answer. Here is the link in case someone else  
stumbles on this:  
[http://www.elasticsearch.org/guide/reference/api/search/indices-types.html](http://www.elasticsearch.org/guide/reference/api/search/indices-types.html)

It suggests one may query multiple types OR multiple indices OR all  
indices (for given type or even all types)  
-- but not arbitrary combinations of indices and types.

Best,  
Michael

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [December 4, 2011, 2:50pm UTC](https://discuss.elastic.co/t/multi-tenancy/6058/3 "2011-12-04T14:50:59Z")

</div>

You should be able to search over multiple indices and multiple types.

On Fri, Dec 2, 2011 at 11:31 PM, michaelgeis [michaelgeis11@gmail.com](mailto:michaelgeis11@gmail.com)wrote:

> I guess I found my answer. Here is the link in case someone else  
> stumbles on this:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/indices-types.html)
> 
> It suggests one may query multiple types OR multiple indices OR all  
> indices (for given type or even all types)  
> -- but not arbitrary combinations of indices and types.
> 
> Best,  
> Michael

---

<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:46am UTC](https://discuss.elastic.co/t/multi-tenancy/6058/4 "2017-07-06T03:46:28Z")

</div>


