GET (인덱스 확인)
$ curl -XGET [elasticsearch주소] [Index이름] (?pretty)
PUT (인덱스 생성)
$ curl -XPUT [elasticsearch주소] [Index이름]
POST (document 생성)
$ curl -XPOST [elasticsearch주소] [Index이름] [type명] [id] [Content-type] -d '
파일을 직접 올릴 경우 @파일명 추가
예) curl -XPOST http://localhost:9200/classes/class/1/ -H'Content-Type: application/json' -d '
DELETE (인덱스 삭제)
$ curl -XDELETE [elasticsearch주소] [Index이름]
데이터 업데이트
$ curl -XPOST [elasticsearch주소] [Index이름] [type명] [id]_update (?pretty) -d '
> {"doc" : {"unit" : 2}} ' ==> doc 값이 2로 수정
> {"script" : "ctx._source.unit += 5"} ' ==> doc값이 기존값에서 2더해진 값으로 수정
Bulk
여러개의 document를 한번에 elasticsearch에 삽입한다
Search
$ curl -XGET localhost:9200/basketball/record/_search?pretty
Query의 points가 30인 것만 나타내기
방법 1. URI옵션
$ curl -XGET 'localhost:9200/basketball/record/_search?q=points:30&pretty'
방법 2. Request body
curl -XGET 'localhost:9200/basketball/record/_search -d'
{
"query":{
"term": {"points":30}
}
}'
'오픈소스 > ELK stack' 카테고리의 다른 글
도커 컴포즈(Docker Compose)로 elk 구성하기 (0) | 2021.07.21 |
---|---|
[Kibana] 기본 개념 정리 (0) | 2021.07.01 |
[ElasticSearch] 어그리게이션 (Aggregation) (0) | 2021.06.30 |
[ElasticSearch] 매핑(Mapping) (0) | 2021.06.30 |
[Elastic Search] 기본 개념 정리 (0) | 2021.06.30 |
GET (인덱스 확인)
$ curl -XGET [elasticsearch주소] [Index이름] (?pretty)
PUT (인덱스 생성)
$ curl -XPUT [elasticsearch주소] [Index이름]
POST (document 생성)
$ curl -XPOST [elasticsearch주소] [Index이름] [type명] [id] [Content-type] -d '
파일을 직접 올릴 경우 @파일명 추가
예) curl -XPOST http://localhost:9200/classes/class/1/ -H'Content-Type: application/json' -d '
DELETE (인덱스 삭제)
$ curl -XDELETE [elasticsearch주소] [Index이름]
데이터 업데이트
$ curl -XPOST [elasticsearch주소] [Index이름] [type명] [id]_update (?pretty) -d '
> {"doc" : {"unit" : 2}} ' ==> doc 값이 2로 수정
> {"script" : "ctx._source.unit += 5"} ' ==> doc값이 기존값에서 2더해진 값으로 수정
Bulk
여러개의 document를 한번에 elasticsearch에 삽입한다
Search
$ curl -XGET localhost:9200/basketball/record/_search?pretty
Query의 points가 30인 것만 나타내기
방법 1. URI옵션
$ curl -XGET 'localhost:9200/basketball/record/_search?q=points:30&pretty'
방법 2. Request body
curl -XGET 'localhost:9200/basketball/record/_search -d'
{
"query":{
"term": {"points":30}
}
}'
'오픈소스 > ELK stack' 카테고리의 다른 글
도커 컴포즈(Docker Compose)로 elk 구성하기 (0) | 2021.07.21 |
---|---|
[Kibana] 기본 개념 정리 (0) | 2021.07.01 |
[ElasticSearch] 어그리게이션 (Aggregation) (0) | 2021.06.30 |
[ElasticSearch] 매핑(Mapping) (0) | 2021.06.30 |
[Elastic Search] 기본 개념 정리 (0) | 2021.06.30 |