top_hit

This is commonly used to group documents together and then use the size to limit the groups generated from the top hits. It can be used as the buckets generator for top-level aggregation. This example aims to find the top five morningstar_category based on the number of ETFs in the cf_etf index. The top five categories are Diversified Emerging Mkts, Large Blend, Miscellaneous Region, Europe Stock, and Technology:

"aggs": {"category_top_hits": {"terms": {"field":"morningstar_category","size": 5},"aggs":{"category_top_hits": {"top_hits": {}}}}}
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.23.99.226