# Limit per type for multi-type search in single query

**URL:** <https://discuss.elastic.co/t/limit-per-type-for-multi-type-search-in-single-query/4424>\
**Category:** Elasticsearch\
**Created:** [May 17, 2011, 4:27pm UTC](https://discuss.elastic.co/t/limit-per-type-for-multi-type-search-in-single-query/4424 "2011-05-17T16:27:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_Stafford](https://avatars.discourse-cdn.com/v4/letter/e/45deac/32.png) [@Ed\_Stafford](https://discuss.elastic.co/u/Ed_Stafford)\
**Post date:** [May 17, 2011, 4:27pm UTC](https://discuss.elastic.co/t/limit-per-type-for-multi-type-search-in-single-query/4424/1 "2011-05-17T16:27:13Z")

</div>

Hi all,

I was wondering if anyone encountered a need to do a query across  
multiple types but limit the results per type? So if I have images and  
articles both with tags but I only want a max of 5 docs each.

More to the point, I'm trying to do a search across two types but have  
them intermingled and sorted based on date(last\_update).

I know I can do this programmatically across two searches and join  
them but I'm curious if ES can support this out of the box. Maybe  
that's the best way.

Cheers,  
-Ed

---

<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, 4:05am UTC](https://discuss.elastic.co/t/limit-per-type-for-multi-type-search-in-single-query/4424/2 "2017-07-06T04:05:58Z")

</div>


