# Approx top count in ElasticSearch

**URL:** <https://discuss.elastic.co/t/approx-top-count-in-elasticsearch/124879>\
**Category:** Elasticsearch\
**Created:** [March 21, 2018, 12:06am UTC](https://discuss.elastic.co/t/approx-top-count-in-elasticsearch/124879 "2018-03-21T00:06:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![premieredigital](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/premieredigital/32/26987_2.png) [@premieredigital](https://discuss.elastic.co/u/premieredigital)\
**Post date:** [March 21, 2018, 12:06am UTC](https://discuss.elastic.co/t/approx-top-count-in-elasticsearch/124879/1 "2018-03-21T00:06:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 18, 2018, 12:07am UTC](https://discuss.elastic.co/t/approx-top-count-in-elasticsearch/124879/2 "2018-04-18T00:07:14Z")

</div>

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