일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Java
- licence delete curl
- matplotlib
- Test
- Mac
- license delete
- sort
- 900gle
- zip 파일 암호화
- API
- aggs
- Elasticsearch
- query
- plugin
- flask
- docker
- MySQL
- License
- springboot
- Kafka
- analyzer test
- Python
- TensorFlow
- aggregation
- ELASTIC
- token filter test
- 차트
- zip 암호화
- high level client
- 파이썬
Archives
- Today
- Total
개발잡부
[es] Array Aggregations 본문
반응형
Array 형식으로 색인된 필드를 집계해보잣
인덱스 생성
PUT aggs_doo
{
"settings": {
"index": {
"number_of_shards": 3,
"number_of_replicas": 0
}
},
"mappings": {
"properties": {
"msg": {
"type": "keyword"
}
}
}
}
색인
PUT aggs_doo/_doc/1
{
"msg":["AAA", "BBB"]
}
PUT aggs_doo/_doc/2
{
"msg":["AAA", "CCC"]
}
조회
GET aggs_doo/_search
{
"size": 0,
"query": {
"match_all": {}
},
"aggs": {
"MSG": {
"terms": {
"field": "msg",
"size": 20,
"min_doc_count": 1,
"shard_min_doc_count": 0,
"show_term_doc_count_error": false,
"order": [
{
"_count": "desc"
},
{
"_key": "asc"
}
]
}
}
}
}
결과 값

반응형
'ElasticStack > Elasticsearch' 카테고리의 다른 글
[es] nested aggregation (0) | 2022.07.16 |
---|---|
[es] aggregation test 1 (0) | 2022.07.16 |
[es] Aggregations (0) | 2022.07.14 |
[es] bucket aggregations (0) | 2022.07.14 |
[es] aggregations script (0) | 2022.07.14 |
Comments