# SearchRequest for JSON query

**URL:** <https://discuss.elastic.co/t/searchrequest-for-json-query/136970>\
**Category:** Elasticsearch\
**Created:** [June 22, 2018, 5:15am UTC](https://discuss.elastic.co/t/searchrequest-for-json-query/136970 "2018-06-22T05:15:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumarroopesh](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@kumarroopesh](https://discuss.elastic.co/u/kumarroopesh)\
**Post date:** [June 22, 2018, 5:15am UTC](https://discuss.elastic.co/t/searchrequest-for-json-query/136970/1 "2018-06-22T05:15:23Z")

</div>

Hi,  
I am using RestHighLevelClient for my project. I have JSON queries to be executed and get the response and parse them.  
Earlier I was using low level RestClient.Get to get the response.  
Please help me in doing the same with RestHighLevelClient.

Thanks

---

<div class="post-metadata">

**Author:** ![pjanzen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pjanzen/32/13756_2.png) [@pjanzen](https://discuss.elastic.co/u/pjanzen)\
**Post date:** [June 22, 2018, 5:45am UTC](https://discuss.elastic.co/t/searchrequest-for-json-query/136970/2 "2018-06-22T05:45:07Z")

</div>

my java is a bit rusty but from the docs I read this

> High level REST client that wraps an instance of the low level RestClient and allows to build requests and read responses

This would let me to believe you should be able to do the same calls as you would do with the low level client.

[Full java doc here](https://artifacts.elastic.co/javadoc/org/elasticsearch/client/elasticsearch-rest-high-level-client/6.3.0/org/elasticsearch/client/RestHighLevelClient.html)

---

<div class="post-metadata">

**Author:** ![kumarroopesh](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@kumarroopesh](https://discuss.elastic.co/u/kumarroopesh)\
**Post date:** [June 22, 2018, 6:13am UTC](https://discuss.elastic.co/t/searchrequest-for-json-query/136970/3 "2018-06-22T06:13:27Z")

</div>

Hi Pjanzen,  
Thanks for the reply.  
Sorry it was my bad. Earlier I was using transportclient to do get searchtemplateresponse.

```
SearchTemplateResponse response =
                new SearchTemplateRequestBuilder(transportClient)
            .setRequest(searchRequest)
            .setScript(query)
            .setScriptType(ScriptType.INLINE)
            .get();

```

Now I am looking for the way to do it by RestHighLevelClient, as transportclient will be removed in coming versions I suppose.

Thanks

---

<div class="post-metadata">

**Author:** ![kumarroopesh](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@kumarroopesh](https://discuss.elastic.co/u/kumarroopesh)\
**Post date:** [June 28, 2018, 7:47am UTC](https://discuss.elastic.co/t/searchrequest-for-json-query/136970/4 "2018-06-28T07:47:09Z")

</div>

Hi,  
Can someone please confirm, whether it is even possible in elasticsearch 6.3.0 to replace transportclient with resthighlevelclient?

I need to conclude it soon.  
Please help.

---

<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:** [June 28, 2018, 8:03am UTC](https://discuss.elastic.co/t/searchrequest-for-json-query/136970/5 "2018-06-28T08:03:21Z")

</div>

Not all the features are available but I'd say that the Rest Client is in a good shape.

---

<div class="post-metadata">

**Author:** ![kumarroopesh](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@kumarroopesh](https://discuss.elastic.co/u/kumarroopesh)\
**Post date:** [July 2, 2018, 7:36am UTC](https://discuss.elastic.co/t/searchrequest-for-json-query/136970/6 "2018-07-02T07:36:30Z")

</div>

Thanks @dadoonet,  
So Either I have to wait for replacing transportclient, or I need to change the way my elasticsearchUI works.  
I will see what can be done.

Thanks again.

---

<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:** [July 2, 2018, 7:56am UTC](https://discuss.elastic.co/t/searchrequest-for-json-query/136970/7 "2018-07-02T07:56:04Z")

</div>

Or use the Low Level client for what is not implemented yet. That's not hard to use IMO.

---

<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 30, 2018, 7:56am UTC](https://discuss.elastic.co/t/searchrequest-for-json-query/136970/8 "2018-07-30T07:56:06Z")

</div>

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