본문 바로가기
ELK

[ElasticSearch] bucket aggregation

by 슈슈슉민 2025. 3. 29.

초기 세팅

basketball.json 과 basketball_mapping.json을 준비한다. 

https://github.com/Hongmebuilding/BigData/blob/master/ch04/basketball_mapping.json

 

BigData/ch04/basketball_mapping.json at master · Hongmebuilding/BigData

ElasticSearch 실습 자료. Contribute to Hongmebuilding/BigData development by creating an account on GitHub.

github.com

 

아래와 같이 data를 mapping 한다.

curl -XPUT -k -u elastic:elastic -H "Content-Type: application/json" "https://localhost:9200/basketball/_mapping?pretty" -d @basketball_mapping.json

 

그리고 한번 확인한다.

curl -XGET -k -u elastic:elastic "https://localhost:9200/basketball?pretty"

 

aggs를 넣어 search 도 한번 이용해본다.

curl -XPOST -k -u elastic:elastic "https://localhost:9200/_search?pretty" \
  -H "Content-Type: application/json" \
  --data-binary @terms_aggs.json

 

 

'ELK' 카테고리의 다른 글

[Kibana] 처음 세팅 : docker 와 kibana 세팅  (0) 2025.03.29
[ElasticSearch] metric aggregation  (0) 2025.03.29
[ElasticSearch] search  (0) 2025.03.23
[ElasticSearch] mapping  (0) 2025.03.23
[ElasticSearch] 데이터 입력, 조회, 수정, 삭제  (0) 2025.03.23