Elasticsearch 5.x setQuery deprecated

(Diego Corradini) #1

I have a question regarding the last version of Elasticsearch.

Until the previous version I was using the following JAVA API search:

SearchRequestBuilder request = client.prepareSearch(index).setSource(jsonQuery)

Now setSource is deprecated and it is recommended to use setQuery(QueryBuilder) instead.

My question is the following, is it possible to pass the whole json query as before?

Thanks in advanced

(Nik Everett) #2

I think QueryBuilder#wrapperQuery works for the query portion but the rest doesn't have a direct replacement as far as I know.

(Diego Corradini) #3

Thank you for your help Nik

(system) #4

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