Elasticsearch
REST API 사용 :REpresentational State Transfer
https://medium.com/@dydrlaks/rest-api-3e424716bab
json 형식
1. 테이터 입력 조회 삭제
GET(select)
조회
#curl -XGET http://localhost:9200/[index명]
#curl -XGET http://localhost:9200/[index명]?pretty
?pretty - 결과값 깔끔하게 출력
DELETE(delete)
인덱스 삭제
#curl -XDELETE http://localhost:9200/[index명]
PUT(insert)
인덱스 생성
#curl -XPUT http://localhost://9200/[index명]
documment 생성
#curl -XPORT http://localhost:9200/[index명]/[type명]/[id]/-d'{"title":"algorithm","professor":"jhon"}'
파일에 저장되어있는 documment를 이용하여 documment 생성
#curl -XPORT http://localhost:9200/[index명]/[type명]/[id]/-d @[파일명]
POST(update)
#curl -XPORT http://localhost:9200/[index명]/[type명]/[id]/_update -d'{"doc":{"unit":1}}'
2. 벌크(Bulk)
여러개 documment 한번에 입력
#curl -XPOST http://localhost:9200/_bulk?pretty -data-binary @[파일명]
3. 매핑(Mapping) == 스키마
숫자,문자,날짜 구별 데이터 타입 정해줌
4. 데이터 조회 ( search )
5. 메트릭 어그리게이션(metric aggregation)
집합
6. 버켓 어그리게이션(bucket aggregation)
node
index / indices
shard
/var/lib/elasticesarch/node/~~~
'Elastic Stack' 카테고리의 다른 글
Elasticsearch 쿼리 (0) | 2021.05.13 |
---|---|
ELK opendistro-alert Slack 연동 (0) | 2021.05.07 |
elasticsearch 설치된 상태에서 opendistro alert 연동 (0) | 2021.05.07 |
[elasticsearch] ilm (index lifecycle management) (0) | 2020.05.17 |
elasticsearch 대용량 search(export csv) (0) | 2020.05.11 |