I am trying to integrate elasticsearch with android app.
I need to get the jsonobject and print out the details for each id. First I need to try writing java class.
Can I just use json api or is there a elasticsearch api which is easier.
url:http://www.dummy.com:9200/contacts/index/_search
{
"took": 10,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 1.0,
"hits": [
{
"_index": "contacts",
"_type": "index",
"_id": "2",
"_score": 1.0,
"_source": {
"id": "c201",
"name": "Johnny Depp",
"email": "johnny_depp@gmail.com",
"address": "xx-xx-xxxx,x - street, x - country",
"gender": "male",
"phone": {
"mobile": "+91 0000000000",
"home": "00 000000",
"office": "00 000000"
}
}
},
{
"_index": "contacts",
"_type": "index",
"_id": "1",
"_score": 1.0,
"_source": {
"id": "c200",
"name": "Ravi Tamada",
"email": "ravi@gmail.com",
"address": "xx-xx-xxxx,x - street, x - country",
"gender": "male",
"phone": {
"mobile": "+91 0000000000",
"home": "00 000000",
"office": "00 000000"
}
}
}
]
}
}