I have the following documents in elastic search:
[{
"_version": 1,
"uid": "blt275162870bd76359",
"title": "Entry1",
"publish_details": [{
"environment": "blt603fe91adbdcff66",
"locale": "en-us",
"time": "2020-06-27T11:58:17.699Z",
"user": "bltaadab2f531206e9d"
},
{
"environment": "blt603fe91adbdcff66",
"locale": "hi-in",
"time": "2020-06-27T11:58:17.699Z",
"user": "bltaadab2f531206e9d"
}
]
},
{
"_version": 1,
"title": "Entry12",
"uid": "blt275162870bd76359",
"publish_details": [{
"environment": "blt603fe91adbdcff66",
"locale": "mr-in",
"time": "2020-06-27T11:58:17.699Z",
"user": "bltaadab2f531206e9d"
}, {
"environment": "blt603fe91adbdcff67",
"locale": "mr-in",
"time": "2020-06-27T11:58:17.699Z",
"user": "bltaadab2f531206e9d"
}]
},
{
"_version": 1,
"uid": "blt275162870bd763523",
"title": "Entry100",
"publish_details": [{
"environment": "blt603fe91adbdcff66",
"locale": "en-us",
"time": "2020-06-27T11:58:17.699Z",
"user": "bltaadab2f531206e9d"
},
{
"environment": "blt603fe91adbdcff66",
"locale": "hi-in",
"time": "2020-06-27T11:58:17.699Z",
"user": "bltaadab2f531206e9d"
}, {
"environment": "blt603fe91adbdcff66",
"locale": "mr-in",
"time": "2020-06-27T11:58:17.699Z",
"user": "bltaadab2f531206e9d"
}
]
},
{
"_version": 1,
"title": "Entry18",
"uid": "blt275162870bd76355",
"publish_details": [{
"environment": "blt603fe91adbdcff66",
"locale": "en-us",
"time": "2020-06-27T11:58:17.699Z",
"user": "bltaadab2f531206e9d"
}]
},
{
"_version": 1,
"title": "Entry16",
"uid": "blt275162870bd76354",
"publish_details": []
},
{
"_version": 1,
"title": "Entry20",
"uid": "blt275162870bd76353",
"publish_details": [{
"environment": "blt603fe91adbdcff66",
"locale": "en-us",
"time": "2020-06-27T11:58:17.699Z",
"user": "bltaadab2f531206e9d"
}]
}]
and I want the following response:
[{
"uid": "blt275162870bd76359"
},{
"uid": "blt275162870bd763523"
}]
Kindly help me here to create a query for this? publish_details has nested datatype. I want that document whose publish_details.locale is hi-in.mr-in and en-us and publish_details.environment is blt603fe91adbdcff66 and with uid check. the reason here is uid blt275162870bd76359 is repeated twice.