我在ElasticSearch中建立了多个文档索引,所有文档的结构如下:
{
id: "54",
name: "John Doe",
booking: {
"phoneNr": "3442342342",
"payment_type": "CREDIT_CARD",
"price": 500,
"flightDetails": {
"travellers": [...],
"flightLegs": [
{
"departureAirport": "NYC",
"arrivalAirport": "BER",
....
},
{
"departureAirport": "BER",
"arrivalAirport": "DXB",
....
},
{
"departureAirport": "DXB",
"arrivalAirport": "MUM",
....
}
]
}
}
}
现在,我要获取此索引中在最后一站中将arrivalAirport作为“ XYZ”的所有文档。因此,由于最后一站的到达机场为“ MUM”,因此上述文档不会减少。我该如何实施?查询是什么样的?