May be this question was asked before See actual JSON from SearchRequestBuilder but I am completely new to the elastic search.
I am trying to find a way to convert the queryBuilder/searchSourceBuilder to a Json.
I am trying out the very basic "match_all" query like below:
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); searchSourceBuilder.query(QueryBuilders.matchAllQuery()); searchSourceBuilder.from(0); searchSourceBuilder.size(5);
I need to send the "json" from this builder to the REST end point to grab the results.
Please help me find out how can I convert the builder to json
Also, I am not able to find any examples on how to use SearchRequestBuilder to see if I can use the above mentioned link for my use case.