8.3 하위 - sub-aggregations
이 문서의 허가되지 않은 무단 복제나 배포 및 출판을 금지합니다. 본 문서의 내용 및 도표 등을 인용하고자 하는 경우 출처를 명시하고 김종민([email protected])에게 사용 내용을 알려주시기 바랍니다.
GET my_stations/_search
{
"size": 0,
"aggs": {
"stations": {
"terms": {
"field": "station.keyword"
},
"aggs": {
"avg_psg_per_st": {
"avg": {
"field": "passangers"
}
}
}
}
}
}{
"took" : 3,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 10,
"relation" : "eq"
},
"max_score" : null,
"hits" : [ ]
},
"aggregations" : {
"stations" : {
"doc_count_error_upper_bound" : 0,
"sum_other_doc_count" : 0,
"buckets" : [
{
"key" : "강남",
"doc_count" : 5,
"avg_psg_per_st" : {
"value" : 5931.2
}
},
{
"key" : "불광",
"doc_count" : 1,
"avg_psg_per_st" : {
"value" : 971.0
}
},
{
"key" : "신촌",
"doc_count" : 1,
"avg_psg_per_st" : {
"value" : 3912.0
}
},
{
"key" : "양재",
"doc_count" : 1,
"avg_psg_per_st" : {
"value" : 4121.0
}
},
{
"key" : "종각",
"doc_count" : 1,
"avg_psg_per_st" : {
"value" : 2314.0
}
},
{
"key" : "홍제",
"doc_count" : 1,
"avg_psg_per_st" : {
"value" : 1021.0
}
}
]
}
}
}Last updated