Approx top count in ElasticSearch

I am using BigQuery to get the top ten values for a query with this syntax:

SELECT
    APPROX_TOP_COUNT(first_name, 10),
    APPROX_TOP_COUNT(last_name, 10)
FROM
    <my query>

The result allows me to make something like:

FirstName
- John (40)
- Don (12)
- Sarah (3)

LastName
- Smith (50)
- Jones (5)

Is there a way to do the same in ElasticSearch? Or do I have to do a new query to get each top-n filters. This becomes quite cumbersome and resource-intensive if, for example, we have 20 filters that we need to build.

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