# Deep Paging in ES

**URL:** <https://discuss.elastic.co/t/deep-paging-in-es/8394>\
**Category:** Elasticsearch\
**Created:** [July 12, 2012, 2:33am UTC](https://discuss.elastic.co/t/deep-paging-in-es/8394 "2012-07-12T02:33:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brett\_Wooldridge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brett_wooldridge/32/2819_2.png) [@Brett\_Wooldridge](https://discuss.elastic.co/u/Brett_Wooldridge)\
**Post date:** [July 12, 2012, 2:33am UTC](https://discuss.elastic.co/t/deep-paging-in-es/8394/1 "2012-07-12T02:33:48Z")

</div>

I asked this question the other day, but given no response, possibly I  
wasn't clear enough.

I'm trying to understand whether ES supports "Deep Paging" similar to the  
new deep paging feature added to Lucene (3.5,4.0) and Solr (4.0).

From the Solr docs:

The following list of parameters are supported by SearchHandler[http://wiki.apache.org/solr/SearchHandler](http://wiki.apache.org/solr/SearchHandler)  
...

pageDoc and pageScore

See [https://issues.apache.org/jira/browse/SOLR-1726](https://issues.apache.org/jira/browse/SOLR-1726) If you expect to be  
paging deeply into the results (say beyond page 10, assuming rows=10) and  
you are sorting by score, you may wish to add the pageDoc and pageScore  
parameters to your request. These two parameters tell Solr (and Lucene)  
what the last result (Lucene internal docid and score) of the previous page  
was, so that when scoring the query for the next set of pages, it can  
ignore any results that occur higher than that item. To get the Lucene  
internal doc id, you will need to add [docid] to the &fl list.

Example: q=_:_&start=10&pageDoc=5&pageScore=1.345&fl=[docid],score

Specifically, this feature is enabled by LUCENE-2215[https://issues.apache.org/jira/browse/LUCENE-2215](https://issues.apache.org/jira/browse/LUCENE-2215)with a new method on TopDocs. Does ES support deep paging?

Brett

---

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [July 12, 2012, 2:43am UTC](https://discuss.elastic.co/t/deep-paging-in-es/8394/2 "2012-07-12T02:43:28Z")

</div>

Hi Brett,

That sounds like regular paging. Yes, ES supports it:

> **[Elastic — The Search AI Company](https://www.elastic.co)**
>
> Power insights and outcomes with The Elastic Search AI Platform. See into your data and find answers that matter with enterprise solutions designed to help you accelerate time to insight. Try Elastic ...

## Otis

Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
Scalable Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)

On Wednesday, July 11, 2012 10:33:48 PM UTC-4, Brett Wooldridge wrote:

> I asked this question the other day, but given no response, possibly I  
> wasn't clear enough.
> 
> I'm trying to understand whether ES supports "Deep Paging" similar to the  
> new deep paging feature added to Lucene (3.5,4.0) and Solr (4.0).
> 
> From the Solr docs:
> 
> The following list of parameters are supported by SearchHandler[http://wiki.apache.org/solr/SearchHandler](http://wiki.apache.org/solr/SearchHandler)  
> ...
> 
> pageDoc and pageScore
> 
> See [[SOLR-1726] Deep Paging and Large Results Improvements - ASF Jira](https://issues.apache.org/jira/browse/SOLR-1726) If you expect to be  
> paging deeply into the results (say beyond page 10, assuming rows=10) and  
> you are sorting by score, you may wish to add the pageDoc and pageScore  
> parameters to your request. These two parameters tell Solr (and Lucene)  
> what the last result (Lucene internal docid and score) of the previous page  
> was, so that when scoring the query for the next set of pages, it can  
> ignore any results that occur higher than that item. To get the Lucene  
> internal doc id, you will need to add [docid] to the &fl list.
> 
> Example: q=_:_&start=10&pageDoc=5&pageScore=1.345&fl=[docid],score
> 
> Specifically, this feature is enabled by LUCENE-2215[https://issues.apache.org/jira/browse/LUCENE-2215](https://issues.apache.org/jira/browse/LUCENE-2215)with a new method on TopDocs. Does ES support deep paging?
> 
> Brett

---

<div class="post-metadata">

**Author:** ![hazzadous](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hazzadous/32/1654_2.png) [@hazzadous](https://discuss.elastic.co/u/hazzadous)\
**Post date:** [July 12, 2012, 10:15am UTC](https://discuss.elastic.co/t/deep-paging-in-es/8394/3 "2012-07-12T10:15:11Z")

</div>

Although that I assume will not provide any scoring optimisations?  
Depending on your use case there is a scan search type and constant\_score  
query, which may help.

On Thursday, July 12, 2012 3:43:28 AM UTC+1, Otis Gospodnetic wrote:

> Hi Brett,
> 
> That sounds like regular paging. Yes, ES supports it:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/api/search/from-size.html)
> 
> ## Otis
> 
> Search Analytics - [Cloud Monitoring Tools & Services | Sematext](http://sematext.com/search-analytics/index.html)  
> Scalable Performance Monitoring - [Sematext Monitoring | Infrastructure Monitoring Service](http://sematext.com/spm/index.html)
> 
> On Wednesday, July 11, 2012 10:33:48 PM UTC-4, Brett Wooldridge wrote:
> 
> > I asked this question the other day, but given no response, possibly I  
> > wasn't clear enough.
> > 
> > I'm trying to understand whether ES supports "Deep Paging" similar to the  
> > new deep paging feature added to Lucene (3.5,4.0) and Solr (4.0).
> > 
> > From the Solr docs:
> > 
> > The following list of parameters are supported by SearchHandler[http://wiki.apache.org/solr/SearchHandler](http://wiki.apache.org/solr/SearchHandler)  
> > ...
> > 
> > pageDoc and pageScore
> > 
> > See [[SOLR-1726] Deep Paging and Large Results Improvements - ASF JIRA](https://issues.apache.org/jira/browse/SOLR-1726) If you expect to be  
> > paging deeply into the results (say beyond page 10, assuming rows=10) and  
> > you are sorting by score, you may wish to add the pageDoc and pageScore  
> > parameters to your request. These two parameters tell Solr (and Lucene)  
> > what the last result (Lucene internal docid and score) of the previous page  
> > was, so that when scoring the query for the next set of pages, it can  
> > ignore any results that occur higher than that item. To get the Lucene  
> > internal doc id, you will need to add [docid] to the &fl list.
> > 
> > Example: q=_:_&start=10&pageDoc=5&pageScore=1.345&fl=[docid],score
> > 
> > Specifically, this feature is enabled by LUCENE-2215[https://issues.apache.org/jira/browse/LUCENE-2215](https://issues.apache.org/jira/browse/LUCENE-2215)with a new method on TopDocs. Does ES support deep paging?
> > 
> > Brett

---

<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:20am UTC](https://discuss.elastic.co/t/deep-paging-in-es/8394/4 "2017-07-06T03:20:32Z")

</div>


