# Getting the Facets for infinite or Unknown set of Response

**URL:** <https://discuss.elastic.co/t/getting-the-facets-for-infinite-or-unknown-set-of-response/7047>\
**Category:** Elasticsearch\
**Created:** [March 19, 2012, 9:02am UTC](https://discuss.elastic.co/t/getting-the-facets-for-infinite-or-unknown-set-of-response/7047 "2012-03-19T09:02:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijuitech](https://avatars.discourse-cdn.com/v4/letter/v/bcef8e/32.png) [@vijuitech](https://discuss.elastic.co/u/vijuitech)\
**Post date:** [March 19, 2012, 9:02am UTC](https://discuss.elastic.co/t/getting-the-facets-for-infinite-or-unknown-set-of-response/7047/1 "2012-03-19T09:02:26Z")

</div>

Hi,  
I have a doubt in case of Facets. For the Facets in which the  
size was unaware, For Example

searchRequestBuilder.addFacet(FacetBuilders.termsFacet("namecount").field("namesort").size(10);  
response = searchRequestBuilder.execute().actionGet();

Here I get only 10 Facets. Is there any other method to get the entire  
Facets in which the size is unaware or the facets for the complete  
response?.

Let us consider,

# Name Value

A 11

B 3

A 4

C 7

C 4

D 33  
.  
.  
.  
.  
etc

For this if I want to get the Facets of size 3

searchRequestBuilder.addFacet(FacetBuilders.termsFacet("namecount").field("namesort").size(3);  
response = searchRequestBuilder.execute().actionGet();

I will get the Facets as

"facets" : {  
"namecount" : {  
"\_type" : "terms",  
"missing" : 0,  
"total" : 280,  
"other" : 0,  
"terms" : [ {  
"term" : "",  
"count" : 259  
}, {  
"term" : "A",  
"count" :2  
}, {  
"term" : "C",  
"count" : 2  
}, {  
"term" : "B",  
"count" : 1  
},

Here the count of D is Missing...Is there any other method to get the  
Facets of all response?

Cheers!!

George

---

<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:35am UTC](https://discuss.elastic.co/t/getting-the-facets-for-infinite-or-unknown-set-of-response/7047/2 "2017-07-06T03:35:37Z")

</div>


