# Scroll API with SearchTemplateRequest

**URL:** <https://discuss.elastic.co/t/scroll-api-with-searchtemplaterequest/246510>\
**Category:** Elasticsearch\
**Created:** [August 26, 2020, 8:50pm UTC](https://discuss.elastic.co/t/scroll-api-with-searchtemplaterequest/246510 "2020-08-26T20:50:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ljr9600](https://avatars.discourse-cdn.com/v4/letter/l/ce7236/32.png) [@ljr9600](https://discuss.elastic.co/u/ljr9600)\
**Post date:** [August 26, 2020, 8:50pm UTC](https://discuss.elastic.co/t/scroll-api-with-searchtemplaterequest/246510/1 "2020-08-26T20:50:39Z")

</div>

There doesn't seem to be a way to use the scroll api with SearchTemplateRequest() from the Java high level client.

Is this a feature request, or a bug/miss?

I use moustache to expand complex json queries. So I could do a simulate with the SearchTemplateRequest(), and extract the search request json in the searchTemplateResponse, via:  
` BytesReference bytes=searchTemplateResponse.getSource(); `  
And then use the json to build a standard SearchRequest with scroll.

The issue with this method is that I don't know how to use the Java high level client to submit a pure json based search request. (I tried WrapperQueryBuilder() - but it failed).

I can't find any samples in the docs to do this either.

---

<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 23, 2020, 8:50pm UTC](https://discuss.elastic.co/t/scroll-api-with-searchtemplaterequest/246510/2 "2020-09-23T20:50:49Z")

</div>

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