【发布时间】:2018-02-06 20:41:30
【问题描述】:
我有以下文档,它已被 ElasticSearch 5.5 编入索引
{
"dept_id": "DP123",
"related_depts": [
{
"id": "DP222",
"roles": [
{
"status": null,
"persons": [
{
"id": "P123",
"roles": [
{
"status": null
}
]
},
{
"id": "P124",
"roles": [
{
"status": null
}
]
}
]
}
]
}
]
}
现在,我想搜索所有具有 persons id=P123 的文档 我使用以下命令进行搜索。
curl -XPOST 'localhost:9200/_search?pretty' -H 'Content-Type: application/json' -d'
{
"query": {
"nested" : {
"path" : "related_depts.roles.persons",
"query" : {
"match" : {
"id": "P123"
}
}
}
}
}
'
我收到以下错误。
failed to find nested object under path [related_depts.roles.persons]
【问题讨论】:
标签: elasticsearch elasticsearch-5