Site icon Hip-Hop Website Design and Development

search: get minimal variety of publish for every publish sort

I’ve a small concern with the default search, I wish to search cross completely different post_types and returning for instance 5 objects. On this second if I seek for the phrase: foo and this phrase is in 10 wc merchandise, 3 posts and eight pages the search will return the the 5 product but it surely won’t return any posts or pages, what I want to have is that the search return:

5 merchandise
3 posts
5 pages

is it doable by some means?

many thanks
Francesco