Search API by JSON

Hi, I have been using Elasticsearch through Java API. In order to search I send a JSON document to build the search query as follows

WrapperQueryBuilder WrapperQueryObj = QueryBuilders.wrapperQuery();
elasticclient.prepareSearch(indexname).setTypes(datatype).setQuery(WrapperQueryObj).setFrom(beginingAt).setSize(doclength).setExplain(true).get();

now, I want to add the SortBuilder. Is there anyway to create a SortBuilder from a JSON String or Array like the Querybuilder? QueryBuilders is awesome which reduces tens of code into one line.

Thanks in advance.

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