0
我一直保存在该物体像这样ElasticSearch查询嵌套的对象不会返回结果
{
"_index": "sessions_user_dev",
"_type": "user",
"_id": "322",
"_version": 1,
"_source": {
"id": 322,
"createdAt": "2015-07-09T00:12:45+00:00",
"firstName": "Amy",
"lastName": "John",
"openLocations": [
{
"id": 4,
"code": "QLD",
"label": "Queensland",
"country": "AU"
}
]
}
}
而且我想设置为openLocations的术语,这里是我的代码
{
"query": {
"term": {
"user.openLocations.code": {
"value": "QLD"
}
}
}
}
但返回零结果。我也尝试将该字段更改为openLocations.code,但没有用户盈方,但仍然没有运气。还试过:
{
"query": {
"bool": {
"filter": {
"bool": {
"must": [
{
"term": {
"openLocations.code": "QLD"
}
}
]
}
}
}
}
}
但仍然没有结果。试图使用嵌套查询,但它总是说[嵌套]无法找到路径[user.openLocations]下的嵌套对象。
我Elasticsearch 5.4
THX提前