2
我想只獲取嵌套字段,但不能,因爲它不是葉字段。Elasticsearch - 獲取嵌套字段
GET index/_search
{
"size": 10,
"fields": [
"nested_fields"
]
}
ERROR : "reason": "field [nested_fields] isn't a leaf field"
下面我試過,但不能在嵌套的對象每個ID和名稱相匹配。
GET index/_search
{
"size": 10,
"fields": [
"nested_fields.id",
"nested_fields.name"
]
}
結果:
"fields": {
"events.id": [
"13342",
"24232",
"25534",
"63454"
],
"events.name": [
"R1413",
"R1414",
"R1415",
"R1416",
]
}
這是我期望的結果:
fields" : {
"evets" : {
"id" : "234234",
"name" : "RP1524"
},
.... so on
}
第一個爲我工作。謝謝 :) –