以下脚本是目前es库中存的数据,其中phones为集合,现需要找出大于两个号码以上的人员,现请教各位大神如何写这个数组大小的查询语法?{
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 1,
"hits": [
{
"_index": "test",
"_type": "mytype",
"_id": "2",
"_score": 1,
"_source": {
"xm": "刘星星",
"phones": [
{
"phone_type": "住宅电话",
"phone_number": "0756-3333333"
},
{
"phone_type": "移动电话",
"phone_number": "13431240077"
}
]
}
},
{
"_index": "test",
"_type": "mytype",
"_id": "1",
"_score": 1,
"_source": {
"xm": "张三三",
"phones": {
"phone_type": "住宅电话",
"phone_number": "13431240077"
}
}
}
]
}
}
"took": 1,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 2,
"max_score": 1,
"hits": [
{
"_index": "test",
"_type": "mytype",
"_id": "2",
"_score": 1,
"_source": {
"xm": "刘星星",
"phones": [
{
"phone_type": "住宅电话",
"phone_number": "0756-3333333"
},
{
"phone_type": "移动电话",
"phone_number": "13431240077"
}
]
}
},
{
"_index": "test",
"_type": "mytype",
"_id": "1",
"_score": 1,
"_source": {
"xm": "张三三",
"phones": {
"phone_type": "住宅电话",
"phone_number": "13431240077"
}
}
}
]
}
}
1 个回复
laoyang360 - 《一本书讲透Elasticsearch》作者,Elastic认证工程师 [死磕Elasitcsearch]知识星球地址:http://t.cn/RmwM3N9;微信公众号:铭毅天下; 博客:https://elastic.blog.csdn.net
赞同来自: zyb1994111