0
"recordOne": {
  "properties": {
    "id": {
      "type": "integer"
    },
    "recordtwo": {
      "properties": {
        "propertyone": {
          "type": "integer"
        },
        "propertytwo":{
          "type":"date"
        }
      }
    }
  },
  "_parent": {
    "type": "parentrecord"
  }
}

在这里,我正在尝试访问 recordtwo 属性,例如"doc.recordtwo.propertyone"

我得到了这个例外:

'Elasticsearch 异常 [type=illegal_argument_exception,reason=No field found for [recordtwo] in mapping with types [recordOne]]'

虽然我能够访问 id。IE

"doc.id"
4

1 回答 1

0

我在下面尝试过,它有效。

"doc['recordtwo.propertyone']"
于 2018-04-24T11:15:26.583 回答