How to retrieve document in standard json format to store it into string?

When I do Get operation on Index, I get results in the form of
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 3,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 67,
"max_score": 1,
"hits": [
{
"_index": "myindex",
"_type": "mydoc",
"_id": "FzPe_mMB5I2B23RHOy",
"_score": 1,
"_source": { ...
...
...
}

But in my java code, I wanted to store this result of GET operation into Json String.

Is there a way that I can do GET operation where I get standard JSON inside _source. Like when I do get operation I just wanted the output to be like:
{
...
...},
{....
...}

thanks,
Surya

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