# Can i get the total number of facets?

**URL:** <https://discuss.elastic.co/t/can-i-get-the-total-number-of-facets/4586>\
**Category:** Elasticsearch\
**Created:** [June 9, 2011, 8:42am UTC](https://discuss.elastic.co/t/can-i-get-the-total-number-of-facets/4586 "2011-06-09T08:42:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Weiwei\_Wang](https://avatars.discourse-cdn.com/v4/letter/w/b19c9b/32.png) [@Weiwei\_Wang](https://discuss.elastic.co/u/Weiwei_Wang)\
**Post date:** [June 9, 2011, 8:42am UTC](https://discuss.elastic.co/t/can-i-get-the-total-number-of-facets/4586/1 "2011-06-09T08:42:33Z")

</div>

I need to get the number of certain distinct field values and I tried  
termfacets.

I have to retrieve all the facets to get the total number of distinct  
values, this may delay the process.

Does anybody here know the solution?

---

<div class="post-metadata">

**Author:** ![fashionalwallet](https://avatars.discourse-cdn.com/v4/letter/f/839c29/32.png) [@fashionalwallet](https://discuss.elastic.co/u/fashionalwallet)\
**Post date:** [June 9, 2011, 8:53am UTC](https://discuss.elastic.co/t/can-i-get-the-total-number-of-facets/4586/2 "2011-06-09T08:53:18Z")

</div>

- deleted -

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [June 9, 2011, 12:08pm UTC](https://discuss.elastic.co/t/can-i-get-the-total-number-of-facets/4586/3 "2011-06-09T12:08:46Z")

</div>

On Thu, 2011-06-09 at 01:42 -0700, Weiwei Wang wrote:

> I need to get the number of certain distinct field values and I tried  
> termfacets.
> 
> I have to retrieve all the facets to get the total number of distinct  
> values, this may delay the process.

That is the only way to do this currently

clint

---

<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:** [July 6, 2017, 4:04am UTC](https://discuss.elastic.co/t/can-i-get-the-total-number-of-facets/4586/4 "2017-07-06T04:04:19Z")

</div>


