# Is pagination possible in termsStatsFacet?

**URL:** <https://discuss.elastic.co/t/is-pagination-possible-in-termsstatsfacet/5605>\
**Category:** Elasticsearch\
**Created:** [October 14, 2011, 9:51pm UTC](https://discuss.elastic.co/t/is-pagination-possible-in-termsstatsfacet/5605 "2011-10-14T21:51:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gautam\_S](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@Gautam\_S](https://discuss.elastic.co/u/Gautam_S)\
**Post date:** [October 14, 2011, 9:51pm UTC](https://discuss.elastic.co/t/is-pagination-possible-in-termsstatsfacet/5605/1 "2011-10-14T21:51:17Z")

</div>

Hi,

Is pagination possible in termsStatsFacet?  
There is a way to provide the size parameter to limit the results.  
Is there a way to specify the results to be sent from 11-20 or 21-30 ...

Pagination is possible in QueryBuilder. Just wondering if its possible in  
termsStatsFacet as well?

Would appreciate your response.

Thanks  
Gautam

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 15, 2011, 10:18am UTC](https://discuss.elastic.co/t/is-pagination-possible-in-termsstatsfacet/5605/2 "2011-10-15T10:18:08Z")

</div>

No, there isn't an option to paginate the results of a terms / terms stats  
facets. You need to ask for a bigger size.

On Fri, Oct 14, 2011 at 11:51 PM, Gautam Shyamantak [gautam@datarpm.com](mailto:gautam@datarpm.com)wrote:

> Hi,
> 
> Is pagination possible in termsStatsFacet?  
> There is a way to provide the size parameter to limit the results.  
> Is there a way to specify the results to be sent from 11-20 or 21-30 ...
> 
> Pagination is possible in QueryBuilder. Just wondering if its possible in  
> termsStatsFacet as well?
> 
> Would appreciate your response.
> 
> Thanks  
> Gautam

---

<div class="post-metadata">

**Author:** ![Gautam\_S](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@Gautam\_S](https://discuss.elastic.co/u/Gautam_S)\
**Post date:** [October 15, 2011, 10:36am UTC](https://discuss.elastic.co/t/is-pagination-possible-in-termsstatsfacet/5605/3 "2011-10-15T10:36:43Z")

</div>

Thanks Shay for confirmation!

I tried using QueryBuilder to paginate and fetch paginated terms to restrict  
the termsStatsFacet result.  
But then it prohibits from ordering the data on "Total". Which is why I now  
relying on a fake pagination where I just keep increasing the size.

The problem is that, as unique terms increases the performance of  
termsStatsFacet degrades quiet drastically.  
Any plans to support pagination in near future?

Thanks  
Gautam

On Sat, Oct 15, 2011 at 3:48 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> No, there isn't an option to paginate the results of a terms / terms stats  
> facets. You need to ask for a bigger size.
> 
> On Fri, Oct 14, 2011 at 11:51 PM, Gautam Shyamantak [gautam@datarpm.com](mailto:gautam@datarpm.com)wrote:
> 
> > Hi,
> > 
> > Is pagination possible in termsStatsFacet?  
> > There is a way to provide the size parameter to limit the results.  
> > Is there a way to specify the results to be sent from 11-20 or 21-30 ...
> > 
> > Pagination is possible in QueryBuilder. Just wondering if its possible in  
> > termsStatsFacet as well?
> > 
> > Would appreciate your response.
> > 
> > Thanks  
> > Gautam

--  
Gautam  
Co-Founder, DataRPM  
+91 9886021223 | [gautam@datarpm.com](mailto:gautam@datarpm.com) [ruban@datarpm.com](mailto:ruban@datarpm.com) | [http://datarpm.com](http://datarpm.com)  
\*DataRPM [http://datarpm.com/](http://datarpm.com/): **Stay Connected With Your Business Data!!**  
\*

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 15, 2011, 1:05pm UTC](https://discuss.elastic.co/t/is-pagination-possible-in-termsstatsfacet/5605/4 "2011-10-15T13:05:35Z")

</div>

Do you mean that for the same search request, with just a different size for  
the terms stats, you see a big difference in performance? What are those  
different sizes that you test on?

On Sat, Oct 15, 2011 at 12:36 PM, Gautam Shyamantak [gautam@datarpm.com](mailto:gautam@datarpm.com)wrote:

> Thanks Shay for confirmation!
> 
> I tried using QueryBuilder to paginate and fetch paginated terms to  
> restrict the termsStatsFacet result.  
> But then it prohibits from ordering the data on "Total". Which is why I now  
> relying on a fake pagination where I just keep increasing the size.
> 
> The problem is that, as unique terms increases the performance of  
> termsStatsFacet degrades quiet drastically.  
> Any plans to support pagination in near future?
> 
> Thanks  
> Gautam
> 
> On Sat, Oct 15, 2011 at 3:48 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > No, there isn't an option to paginate the results of a terms / terms stats  
> > facets. You need to ask for a bigger size.
> > 
> > On Fri, Oct 14, 2011 at 11:51 PM, Gautam Shyamantak [gautam@datarpm.com](mailto:gautam@datarpm.com)wrote:
> > 
> > > Hi,
> > > 
> > > Is pagination possible in termsStatsFacet?  
> > > There is a way to provide the size parameter to limit the results.  
> > > Is there a way to specify the results to be sent from 11-20 or 21-30 ...
> > > 
> > > Pagination is possible in QueryBuilder. Just wondering if its possible in  
> > > termsStatsFacet as well?
> > > 
> > > Would appreciate your response.
> > > 
> > > Thanks  
> > > Gautam
> 
> --  
> Gautam  
> Co-Founder, DataRPM  
> +91 9886021223 | [gautam@datarpm.com](mailto:gautam@datarpm.com) [ruban@datarpm.com](mailto:ruban@datarpm.com) |  
> [http://datarpm.com](http://datarpm.com)  
> \*DataRPM [http://datarpm.com/](http://datarpm.com/): \*\*Stay Connected With Your Business Data!!
> 
> * * *

---

<div class="post-metadata">

**Author:** ![Gautam\_S](https://avatars.discourse-cdn.com/v4/letter/g/ebca7d/32.png) [@Gautam\_S](https://discuss.elastic.co/u/Gautam_S)\
**Post date:** [October 16, 2011, 9:26pm UTC](https://discuss.elastic.co/t/is-pagination-possible-in-termsstatsfacet/5605/5 "2011-10-16T21:26:32Z")

</div>

Yes for the same search request the performance degrades if I don't limit  
the size.

I have indexed about 1 million documents, each document is of 10 kb.  
Runs on one node with the default ES configuration.  
The number of unique values are 1000+

Thanks  
Gautam

On Sat, Oct 15, 2011 at 6:35 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> Do you mean that for the same search request, with just a different size  
> for the terms stats, you see a big difference in performance? What are those  
> different sizes that you test on?
> 
> On Sat, Oct 15, 2011 at 12:36 PM, Gautam Shyamantak [gautam@datarpm.com](mailto:gautam@datarpm.com)wrote:
> 
> > Thanks Shay for confirmation!
> > 
> > I tried using QueryBuilder to paginate and fetch paginated terms to  
> > restrict the termsStatsFacet result.  
> > But then it prohibits from ordering the data on "Total". Which is why I  
> > now relying on a fake pagination where I just keep increasing the size.
> > 
> > The problem is that, as unique terms increases the performance of  
> > termsStatsFacet degrades quiet drastically.  
> > Any plans to support pagination in near future?
> > 
> > Thanks  
> > Gautam
> > 
> > On Sat, Oct 15, 2011 at 3:48 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > 
> > > No, there isn't an option to paginate the results of a terms / terms  
> > > stats facets. You need to ask for a bigger size.
> > > 
> > > On Fri, Oct 14, 2011 at 11:51 PM, Gautam Shyamantak [gautam@datarpm.com](mailto:gautam@datarpm.com)wrote:
> > > 
> > > > Hi,
> > > > 
> > > > Is pagination possible in termsStatsFacet?  
> > > > There is a way to provide the size parameter to limit the results.  
> > > > Is there a way to specify the results to be sent from 11-20 or 21-30 ...
> > > > 
> > > > Pagination is possible in QueryBuilder. Just wondering if its possible  
> > > > in termsStatsFacet as well?
> > > > 
> > > > Would appreciate your response.
> > > > 
> > > > Thanks  
> > > > Gautam

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 16, 2011, 11:41pm UTC](https://discuss.elastic.co/t/is-pagination-possible-in-termsstatsfacet/5605/6 "2011-10-16T23:41:51Z")

</div>

What are the different sizes that you use, and what is the difference  
execution time wise (for the same search query). Also note, you should run  
the search request several times (50) to warm things up before measuring.

On Sun, Oct 16, 2011 at 11:26 PM, Gautam Shyamantak [gautam@datarpm.com](mailto:gautam@datarpm.com)wrote:

> Yes for the same search request the performance degrades if I don't limit  
> the size.
> 
> I have indexed about 1 million documents, each document is of 10 kb.  
> Runs on one node with the default ES configuration.  
> The number of unique values are 1000+
> 
> Thanks  
> Gautam
> 
> On Sat, Oct 15, 2011 at 6:35 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> 
> > Do you mean that for the same search request, with just a different size  
> > for the terms stats, you see a big difference in performance? What are those  
> > different sizes that you test on?
> > 
> > On Sat, Oct 15, 2011 at 12:36 PM, Gautam Shyamantak [gautam@datarpm.com](mailto:gautam@datarpm.com)wrote:
> > 
> > > Thanks Shay for confirmation!
> > > 
> > > I tried using QueryBuilder to paginate and fetch paginated terms to  
> > > restrict the termsStatsFacet result.  
> > > But then it prohibits from ordering the data on "Total". Which is why I  
> > > now relying on a fake pagination where I just keep increasing the size.
> > > 
> > > The problem is that, as unique terms increases the performance of  
> > > termsStatsFacet degrades quiet drastically.  
> > > Any plans to support pagination in near future?
> > > 
> > > Thanks  
> > > Gautam
> > > 
> > > On Sat, Oct 15, 2011 at 3:48 PM, Shay Banon [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:
> > > 
> > > > No, there isn't an option to paginate the results of a terms / terms  
> > > > stats facets. You need to ask for a bigger size.
> > > > 
> > > > On Fri, Oct 14, 2011 at 11:51 PM, Gautam Shyamantak \<[gautam@datarpm.com](mailto:gautam@datarpm.com)
> > > > 
> > > > > wrote:
> > > > 
> > > > > Hi,
> > > > > 
> > > > > Is pagination possible in termsStatsFacet?  
> > > > > There is a way to provide the size parameter to limit the results.  
> > > > > Is there a way to specify the results to be sent from 11-20 or 21-30  
> > > > > ...
> > > > > 
> > > > > Pagination is possible in QueryBuilder. Just wondering if its possible  
> > > > > in termsStatsFacet as well?
> > > > > 
> > > > > Would appreciate your response.
> > > > > 
> > > > > Thanks  
> > > > > Gautam

---

<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:51am UTC](https://discuss.elastic.co/t/is-pagination-possible-in-termsstatsfacet/5605/7 "2017-07-06T03:51:48Z")

</div>


