How to get Minimum 4 results of each Term in my Query


My mapping looks like this:

address text
author text
category text
description text
type text
Where type can be a Collection, Content, Event, Tool.
How can I make sure query will return at least 4 of each tools, events, collections and contents.

You can use a simple terms aggregation [1], with a filter aggregation [2]
on the types requested and then select the top 4 inner hits [3].


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