Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- elasticsearch
- Data Engineering
- package.json
- Crontab
- filebeat
- venv
- node.js
- grok
- airflow
- PYTHON
- elastic
- OPCUA
- dense_vector
- windows
- CSV
- ubuntu
- json
- query
- ELK
- KoA
- typescript
- configure
- Tutorial
- DSL
- devtools
- framework
- 7.7.1
- path.data
- logstash
- kibana
Archives
- Today
- Total
목록AVG (1)
Gibbs Kim's playground
[ElasticStack-16] Terms query & Aggregation (sum, avg)
Elasticsearch로 다음과 같은 항목들이 저장되어 있다고 가정하자. subject score 국어 100 영어 90 수학 80 과학 70 이 때 국여, 영어, 수학에 대한 score 합(sum)과 평균(avg)를 Query를 통하여 구하고 싶다면 다음과 같은 방식으로 표현할 수 있다. GET index/_search { "query": { "terms": { "subject": [ "국어", "영어", "수학" ] } }, "aggs": { "sum_score": { "sum": { "script": { "source": "doc.score.value" } } }, "avg_score": { "avg": { "script": { "source": "doc.score.value" } } } } } ..
Tech 기록지/Elastic Stack
2020. 6. 12. 13:37