Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- bulk post
- 파이썬
- Python.h
- tweepy
- MariaDB
- Pythonic
- js
- KONLPY
- pip install mariadb
- 백준
- ELASTIC
- elastic search
- 토픽모델링
- jvm.py
- gensim
- centos8
- ShallowCopy
- 프로그래머스
- Java
- pyLDAvis
- bs4
- 완주하지못한선수
- dead lock
- 나무자르기
- rest api
- dataframe
- git bash
- pandas
- Jpype
- ChromeDriverManager
Archives
- Today
- Total
부리부리부리
[Elastic Search] Bulk Post 본문
저번까진 postman을 사용하여 강의를 따라갔었다. 그런데 Git Bash를 사용하면 윈도우에서도 Linux 명령어를 사용할 수가 있다고 해서 이제부턴 Git Bash로 강의를 진행한다. ( 나이스요 )
이번 내용은 Bulk Post인데, 여러 개의 document를 한 번에 ES에 삽입하는 방법이다.
명령어는 다음과 같다.
curl -XPOST http://localhost:9200/_bulk?pretty --header 'content-type: application/json' --data-binary @classes.json
위 명령어를 보면 header를 같이 인자로 전송해주었는데, ES 6.0 버전 이상부턴 헤더를 같이 보내야한다고 한다.
이제 결과를 확인해보자.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0{
"took" : 159,
"errors" : false,
"items" : [
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "1",
"_version" : 4,
"result" : "updated",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 5,
"_primary_term" : 2,
"status" : 200
}
},
{
"index" : {
"_index" : "classes",
"_type" : "class",
"_id" : "2",
"_version" : 1,
"result" : "created",
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"_seq_no" : 6,
"_primary_term" : 2,
"status" : 201
}
},
...
(이하 생략)
다시 한번 잘 들어갔는지 XGET으로 확인해보자.
curl -XGET localhost:9200/classes/class/23pretty
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 67 100 67 0 0 18836 0 --:--:-- --:--:-- --:--:-- 22333{"_index":"classes","_type":"class","_id":"23pretty","found":false}
사실 ELK에 대해 아는거 없이 그냥 시작했는데, 지금까지 느낀 점은 Elastic Search는 ELK 중 DB역할을 하는거같은데?
아직 제대로 써보지 않아서 "와 빠르다!" 라는 느낌은 들지 않는다.
'데이터 처리 > ELK' 카테고리의 다른 글
[Elastic Search] Mapping (0) | 2022.12.06 |
---|---|
[Elastic Search] UPDATE (0) | 2022.12.06 |
[Elastic Search] GET, PUT, POST, DELETE (0) | 2022.12.01 |
[Elastic Search] 윈도우로 Elastic Search 설치 (0) | 2022.12.01 |