Transport client 5.0.0 cannot query using the JSON DSL (works via HTTP though)


(Amruth S) #1

Hi, We were using elasticsearch 2.1.0 till now and the following construct was supported

client.prepareSearch(index).setSource(<jsonQuery>)

As per the new elasticsearch 5.0.0 documentation, this is removed in favour of #setQuery(). This is not working for most of the queries involving 'aggregations'.

client.prepareSearch(index) .setQuery(wrapperQuery(jsonQuery);

The wrapper query just seem to wrap the entire json inside a 'query' field. But potentially 'jsonQuery' can have aggregations etc.

Is there any other ways with which this is possible?


(system) #2

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