# Does the PIT API allow scrolling backward?

**URL:** https://discuss.elastic.co/t/does-the-pit-api-allow-scrolling-backward/260129
**Category:** Elasticsearch
**Created:** [January 4, 2021, 8:44pm UTC](https://discuss.elastic.co/t/does-the-pit-api-allow-scrolling-backward/260129 "2021-01-04T20:44:18Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![F\_eq\_kx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/f_eq_kx/32/62217_2.png) [@F\_eq\_kx](https://discuss.elastic.co/u/F_eq_kx)
#### Post date: [January 4, 2021, 8:44pm UTC](https://discuss.elastic.co/t/does-the-pit-api-allow-scrolling-backward/260129/1 "2021-01-04T20:44:18Z")

</div>

The deprecated Scroll API [didn't allow scrolling backward](https://discuss.elastic.co/t/how-to-scroll-back-in-elasticsearch-search-scroll-api/227149/2). Now that it is being replaced, is there a way to do that with PIT?

---

<div class="post-metadata">

### Author: ![nhat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nhat/32/22170_2.png) [@nhat](https://discuss.elastic.co/u/nhat)
#### Post date: [January 5, 2021, 2:14am UTC](https://discuss.elastic.co/t/does-the-pit-api-allow-scrolling-backward/260129/2 "2021-01-05T02:14:45Z")

</div>

Scroll API is not deprecated. You can use PIT with `search_after` to retrieve a previous page.

---

<div class="post-metadata">

### Author: ![F\_eq\_kx](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/f_eq_kx/32/62217_2.png) [@F\_eq\_kx](https://discuss.elastic.co/u/F_eq_kx)
#### Post date: [January 6, 2021, 10:00pm UTC](https://discuss.elastic.co/t/does-the-pit-api-allow-scrolling-backward/260129/3 "2021-01-06T22:00:39Z")

</div>

Maybe I'm using the wrong term, but the docs say we should not longer use the Scroll API. Or does it just mean we should only not use it _for deep pagination_, but there are no plans to deprecate it?

> **[Scroll API | Elasticsearch Reference \[7.10\] | Elastic](https://www.elastic.co/guide/en/elasticsearch//reference/current/scroll-api.html)**

---

<div class="post-metadata">

### Author: ![nhat](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nhat/32/22170_2.png) [@nhat](https://discuss.elastic.co/u/nhat)
#### Post date: [January 7, 2021, 2:11am UTC](https://discuss.elastic.co/t/does-the-pit-api-allow-scrolling-backward/260129/4 "2021-01-07T02:11:56Z")

</div>

Yes, we discourage using scroll for deep pagination.

---

<div class="post-metadata">

### Author: ![annmarie-switzer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/annmarie-switzer/32/82870_2.png) [@annmarie-switzer](https://discuss.elastic.co/u/annmarie-switzer)
#### Post date: [January 25, 2021, 5:05pm UTC](https://discuss.elastic.co/t/does-the-pit-api-allow-scrolling-backward/260129/5 "2021-01-25T17:05:02Z")

</div>

Can you show an example of retrieving a previous page of results with PIT and `search_after`? The docs are pretty clear on how to get the _next_ page but I'm not clear how it works to get the _previous_ page.

---

<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: [February 22, 2021, 5:05pm UTC](https://discuss.elastic.co/t/does-the-pit-api-allow-scrolling-backward/260129/6 "2021-02-22T17:05:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
