I Have google Geocode API, which works well with JSON response, here is the GET
curl -XGET https://maps.googleapis.com/maps/api/geocode/json?address=USA
here is the response
{
"results" : [
{
"address_components" : [
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "United States",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 71.3867745,
"lng" : -66.885417
},
"southwest" : {
"lat" : 18.9110642,
"lng" : 172.4458955
}
},
"location" : {
"lat" : 37.09024,
"lng" : -95.712891
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 49.38,
"lng" : -66.94
},
"southwest" : {
"lat" : 25.82,
"lng" : -124.39
}
}
},
"place_id" : "ChIJCzYy5IS16lQRQrfeQ5K5Oxw",
"types" : [ "country", "political" ]
}
],
"status" : "OK"
}
Now i want to index the same thing in ES, how can I do that.
Also I want to index multiple countries and not just USA
I was trying something like this below, but its not working
curl -XPOST http://localhost:9200/country/address/ -d "{https://maps.googleapis.com/maps/api/geocode/json?address=USA}"