【发布时间】:2018-03-24 20:58:16
【问题描述】:
如何按年和月分组?如果我留下 1 个字词,例如 Month,我的查询就有效。但我不能按多个术语进行分组。
GET traffic-data/_search?
{
"size":0,
"query": {
"bool": {
"must": [
{ "match": {
"VehiclePlateNumber": "111"
}}
]
} },
"aggs" : {
"years" : {
"terms" : {
"field" : "Year"
},
"aggs" : {
"months" : { "by_month" : { "field" : "Month" } }
}
}
}
}
【问题讨论】:
标签: elasticsearch lucene elasticsearch-5