Limit per type for multi-type search in single query


(Ed Stafford) #1

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


(system) #2