본문 바로가기

Elastic Stack

쿼리

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/~~~