SearchRequest for JSON query


(Roopesh Kumar) #1

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


(Pjanzen) #2

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


(Roopesh Kumar) #3

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


(Roopesh Kumar) #4

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.


(David Pilato) #5

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


(Roopesh Kumar) #6

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.


(David Pilato) #7

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


(system) #8

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