Aggregations 3

Elasticsearch Aggregations#4 Sub Aggregations

Aggregations을 수행할 때 사용할 데이터 Sub Aggregations aggregation을 통해 집계를 내고 그 결과에서 세부적인 집계를 위해 Sub Aggregation을 지원하고 있습니다. level 필드별 duration의 평균 시간 구하기 우리는 데이터를 가져오는 것이 목적이 아닌 Aggregations을 수행하는 것이 목적이기 때문에 "size"를 0으로 설정하였습니다. api POST http://localhost:9200/test-log-index-2021-09-12/_search header content-type: application/json body { "size": 0, "query": { "match_all": {} }, "aggs": { "byLevel": { "te..

Elasticsearch 2021.09.19

Elasticsearch Aggregations#3 terms, ranges, histogram, date_range

Aggregation을 수행할 때 사용할 데이터 terms terms는 데이터의 keyword별 종류 및 개수를 집계하는데 사용합니다. 모든 도큐먼트의 level의 종류와 개수 구하기 우리는 데이터를 가져오는 것이 목적이 아닌 Aggregation을 수행하는 것이 목적이기 때문에 "size"를 0으로 설정하였습니다. level 필드의 데이터 종류와 각 종류별로 도큐먼트가 몇개 있는지 확인합니다. api POST http://localhost:9200/test-log-index-2021-09-12/_search header content-type: application/json body { "size": 0, "query": { "match_all": {} }, "aggs": { "byLevel": { "..

Elasticsearch 2021.09.17

Elasticsearch Aggregations#2 cardinality, percentiles, percentile_ranks

Aggregation을 수행할 때 사용할 데이터 cardinality cardinality는 데이터의 종류가 몇 가지 있는지 확인하는 데 사용됩니다. user_id가 1인 도큐먼트에 action이 몇가지 종류가 있는지 확인하기 우리는 데이터를 가져오는 것이 목적이 아닌 Aggregations을 수행하는 것이 목적이기 때문에 "size"를 0으로 설정하였습니다. api POST http://localhost:9200/test-log-index-2021-09-12/_search header content-type: application/json body { "size": 0, "query": { "bool": { "must": [ { "match": { "user_id": "1" } } ] } }, "agg..

Elasticsearch 2021.09.15