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提前