Ok..
I was trying it like this:
String jsonQuery = "{"query": {"term" : { "status": "404" }}}";
//QueryBuilder query = ?? (code to convert json string to queryBuilder object)
SearchResponse response =
client.prepareSearch()
.setIndices("myindex")
.setTypes("log-type")
.setSearchType(SearchType.QUERY_AND_FETCH)
.setQuery(query) //query is of type QueryBuilder
.execute().actionGet();
But not able to covert the json-string to QueryBuilder object properly. Can you help me on this?