# How to use search\_after with rest low client api

**URL:** <https://discuss.elastic.co/t/how-to-use-search-after-with-rest-low-client-api/246156>\
**Category:** Elasticsearch\
**Created:** [August 24, 2020, 4:54pm UTC](https://discuss.elastic.co/t/how-to-use-search-after-with-rest-low-client-api/246156 "2020-08-24T16:54:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishek\_chaturvedi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhishek_chaturvedi/32/74365_2.png) [@abhishek\_chaturvedi](https://discuss.elastic.co/u/abhishek_chaturvedi)\
**Post date:** [August 24, 2020, 4:54pm UTC](https://discuss.elastic.co/t/how-to-use-search-after-with-rest-low-client-api/246156/1 "2020-08-24T16:54:16Z")

</div>

How to use search\_after in below implementation:

```auto
String esQuery = String.format(searchTextQuery, startDate, endDate, formattedQueries);
		request.setJsonEntity(esQuery);
		String offset = String.valueOf((Integer.parseInt(from)*Integer.parseInt(size)));
		request.addParameter("size",size);
		request.addParameter("from",offset);
		Response response = elasticSearchService.getClient().getLowLevelClient().performRequest(request);
		String responseBody = IOUtils.toString(response.getEntity().getContent(), "UTF-8");

```

---

<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:** [September 21, 2020, 4:54pm UTC](https://discuss.elastic.co/t/how-to-use-search-after-with-rest-low-client-api/246156/2 "2020-09-21T16:54:21Z")

</div>

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