IMO there are 2 more features that you should take into account when designing your solution:
specify person in the group_by clause and set missing_bucket to true so that the buckets without a person field are also returned
You can read more about missing_bucket in the docs: Composite aggregation | Elasticsearch Guide [8.11] | Elastic
specify person in the aggregations clause but use top_metrics aggregation instead of terms.
You can read more about top_metrics in this blog:
Are you already tired of hearing Christmas songs? One of the classics is "Driving home for Christmas". The lyrics of that song have not much content, Chris Rea basically tells about a long boring journey in his car driving home. In this post we accompany this song and spice it with new bits and pieces about Transforms . Transforms provide an easy way to summarize data.
And it's been so long
The aim of a search engine - like Elasticsearch - is to provide relevant results quickly. For your family…
2 Likes