Getting a proper JSON from ToXContent

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Getting a proper JSON from ToXContent

nithy1
This post has NOT been accepted by the mailing list yet.
Hi,

I am trying to get json string from Elasticsearch hits. So that a single method can modify the response to particular format to work with another plugin. I have done this previously in javascript. The same has been ported into Java and found to work with test json string data. However, converting using .toXContent(JsonXContent.contentBuilder(),ToXContent.EMPTY_PARAMS).prettyPrint().string() outputs JSON without some syntax like colons(:).

Any advice would be appreciated.