# How to iterate getting the next data using scroll

**URL:** <https://discuss.elastic.co/t/how-to-iterate-getting-the-next-data-using-scroll/227692>\
**Category:** Elasticsearch\
**Created:** [April 12, 2020, 6:19pm UTC](https://discuss.elastic.co/t/how-to-iterate-getting-the-next-data-using-scroll/227692 "2020-04-12T18:19:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![djmarcus](https://avatars.discourse-cdn.com/v4/letter/d/fbc32d/32.png) [@djmarcus](https://discuss.elastic.co/u/djmarcus)\
**Post date:** [April 12, 2020, 6:19pm UTC](https://discuss.elastic.co/t/how-to-iterate-getting-the-next-data-using-scroll/227692/1 "2020-04-12T18:19:04Z")

</div>

I have the following low level request (.Net):

```auto
var scroll = client.LowLevel.Search<StringResponse>(SearchIndex, queryText,
     new SearchRequestParameters()
            {
                 Scroll = TimeSpan.FromMinutes(5)
             });

```

I am getting back Hits and a `_scroll_id`

I can process the Hits, but I don't know how to iterate on the scroll id and get the rest of the data.

In particular, I'm looking for how to code the fetches given the scroll id, something like:

```auto
var scroll2 = client.LowLevel.Scroll<StringResponse>( ?? somehow encode the _scroll_id ?? );

```

-Thanks in advance

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 13, 2020, 1:37am UTC](https://discuss.elastic.co/t/how-to-iterate-getting-the-next-data-using-scroll/227692/2 "2020-04-13T01:37:18Z")

</div>

I don't know how to code that in .Net but the documentation shows a REST call: [https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-scroll](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-scroll)

```
POST /_search/scroll 
{
    "scroll" : "1m", 
    "scroll_id" : "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAD4WYm9laVYtZndUQlNsdDcwakFMNjU1QQ==" 
}
```

---

<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:** [May 11, 2020, 1:37am UTC](https://discuss.elastic.co/t/how-to-iterate-getting-the-next-data-using-scroll/227692/3 "2020-05-11T01:37:23Z")

</div>

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