我正在尝试将elasticsearch与android应用程序集成。
我需要获取jsonobject并打印出每个id的详细信息。首先,我需要尝试编写java类。
我可以只使用json还是有一个更简单的elasticsearch。
网址: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"
}
}
}
]
}
}https://stackoverflow.com/questions/22790222
复制相似问题