# How can i use facet to get the terms count by java api?

**URL:** <https://discuss.elastic.co/t/how-can-i-use-facet-to-get-the-terms-count-by-java-api/9299>\
**Category:** Elasticsearch\
**Created:** [October 10, 2012, 3:26am UTC](https://discuss.elastic.co/t/how-can-i-use-facet-to-get-the-terms-count-by-java-api/9299 "2012-10-10T03:26:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yfdongxu](https://avatars.discourse-cdn.com/v4/letter/y/3da27b/32.png) [@yfdongxu](https://discuss.elastic.co/u/yfdongxu)\
**Post date:** [October 10, 2012, 3:26am UTC](https://discuss.elastic.co/t/how-can-i-use-facet-to-get-the-terms-count-by-java-api/9299/1 "2012-10-10T03:26:44Z")

</div>

I can't find any api to get the count from response.  
But response object's toString function shows that facet info is included in it.

surely need i to analyse the json string myself ??!?

---

<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, 3:09am UTC](https://discuss.elastic.co/t/how-can-i-use-facet-to-get-the-terms-count-by-java-api/9299/2 "2017-07-06T03:09:28Z")

</div>


