Elasticsearch query to update one document using data from another document in the same es

Hi,

I have static data stored in elasticsearch. for example country name and country id

{
"id" : 250,
"name" : "Sri Lanka"
}

{
"id" : 260,
"name" : "India"
}

I am getting another set of attraction data from a web service that has a country id and saved in the same elasticsearch

[{
"countryId" : 250,
"cityid" : 253344,
"attractionName" : "sigiriya"
},
{
"countryId" : 260,
"cityid" : 444345,
"attractionName" : "some attraction"
}]

I need to update the attraction object with the country name without retrieving any data.

[{
"countryId" : 250,
"cityid" : 253344,
"attractionName" : "sigiriya",
"countryName" : "Sri Lanka"
},
{
"countryId" : 260,
"cityid" : 444345,
"attractionName" : "some attraction",
"countryName" : "India"
}]

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