在弹性搜索中以指定索引在数组中搜索术语

时间:2018-10-25 15:26:37

标签: elasticsearch

我在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”,因此上述文档不会减少。我该如何实施?查询是什么样的?

0 个答案:

没有答案