# 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/7048>\
**Category:** Elasticsearch\
**Created:** [March 19, 2012, 9:08am UTC](https://discuss.elastic.co/t/getting-the-facets-for-infinite-or-unknown-set-of-response/7048 "2012-03-19T09:08:56Z")\
**Posts on this page:** 5\
**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:08am UTC](https://discuss.elastic.co/t/getting-the-facets-for-infinite-or-unknown-set-of-response/7048/1 "2012-03-19T09:08:56Z")

</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 I have infinite set of Facets in the response ...Is there any  
other method to get the  
Facets of all response?

Thanks in Advance

Cheers!!  
George

---

<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 20, 2012, 10:32am UTC](https://discuss.elastic.co/t/getting-the-facets-for-infinite-or-unknown-set-of-response/7048/2 "2012-03-20T10:32:03Z")

</div>

Is there any other method in elasticsearch to get the facets of all  
response?

Cheers!!

George

On Mar 19, 2:08 pm, George Viju [vijuit...@gmail.com](mailto:vijuit...@gmail.com) wrote:

> # 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 I have infinite set of Facets in the response ...Is there any  
> other method to get the  
> Facets of all response?
> 
> Thanks in Advance
> 
> Cheers!!George

---

<div class="post-metadata">

**Author:** ![tfreitas](https://avatars.discourse-cdn.com/v4/letter/t/bbe5ce/32.png) [@tfreitas](https://discuss.elastic.co/u/tfreitas)\
**Post date:** [January 23, 2013, 7:20pm UTC](https://discuss.elastic.co/t/getting-the-facets-for-infinite-or-unknown-set-of-response/7048/3 "2013-01-23T19:20:18Z")

</div>

Hello,

any response about "all" size in termsFacet?

On Tuesday, March 20, 2012 6:02:03 AM UTC-4:30, George Viju wrote:

> Is there any other method in elasticsearch to get the facets of all  
> response?
> 
> Cheers!!
> 
> George
> 
> On Mar 19, 2:08 pm, George Viju [vijuit...@gmail.com](mailto:vijuit...@gmail.com) wrote:
> 
> > 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 I have infinite set of Facets in the response ...Is there any  
> > other method to get the  
> > Facets of all response?
> > 
> > Thanks in Advance
> > 
> > Cheers!!George

--

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [February 1, 2013, 3:48pm UTC](https://discuss.elastic.co/t/getting-the-facets-for-infinite-or-unknown-set-of-response/7048/4 "2013-02-01T15:48:42Z")

</div>

You can set size to some very big number (2147483647 for example).

On Wednesday, January 23, 2013 2:20:18 PM UTC-5, tfreitas wrote:

> Hello,
> 
> any response about "all" size in termsFacet?
> 
> On Tuesday, March 20, 2012 6:02:03 AM UTC-4:30, George Viju wrote:
> 
> > Is there any other method in elasticsearch to get the facets of all  
> > response?
> > 
> > Cheers!!
> > 
> > George
> > 
> > On Mar 19, 2:08 pm, George Viju [vijuit...@gmail.com](mailto:vijuit...@gmail.com) wrote:
> > 
> > > 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 I have infinite set of Facets in the response ...Is there any  
> > > other method to get the  
> > > Facets of all response?
> > > 
> > > Thanks in Advance
> > > 
> > > Cheers!!George

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:53am UTC](https://discuss.elastic.co/t/getting-the-facets-for-infinite-or-unknown-set-of-response/7048/5 "2017-07-06T02:53:30Z")

</div>


