Elasticsearch API 묶음처리 bulk

Jmnote (토론 | 기여)님의 2019년 12월 11일 (수) 15:30 판 (새 문서: ==개요== ;Elasticsearch API bulk ;Elasticsearch Bulk API <source lang='bash'> curl -X PUT localhost:9200/_bulk -H 'kbn-xsrf: true' -H 'Content-Type: application/x-ndjson' -d' { "in...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요

Elasticsearch API bulk
Elasticsearch Bulk API
curl -X PUT localhost:9200/_bulk -H 'kbn-xsrf: true' -H 'Content-Type: application/x-ndjson' -d'
{ "index" : { "_index" : "test", "_id" : "1" } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "test", "_id" : "2" } }
{ "create" : { "_index" : "test", "_id" : "3" } }
{ "field1" : "value3" }
{ "update" : {"_id" : "1", "_index" : "test"} }
{ "doc" : {"field2" : "value2"} }
'
root@localhost:~# curl -X PUT localhost:9200/_bulk -H 'kbn-xsrf: true' -H 'Content-Type: application/x-ndjson' -d'
> { "index" : { "_index" : "test", "_id" : "1" } }
> { "field1" : "value1" }
> { "delete" : { "_index" : "test", "_id" : "2" } }
> { "create" : { "_index" : "test", "_id" : "3" } }
> { "field1" : "value3" }
> { "update" : {"_id" : "1", "_index" : "test"} }
> { "doc" : {"field2" : "value2"} }
> '
{"took":728,"errors":false,"items":[{"index":{"_index":"test","_type":"_doc","_id":"1","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1,"status":201}},{"delete":{"_index":"test","_type":"_doc","_id":"2","_version":1,"result":"not_found","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":1,"_primary_term":1,"status":404}},{"create":{"_index":"test","_type":"_doc","_id":"3","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":2,"_primary_term":1,"status":201}},{"update":{"_index":"test","_type":"_doc","_id":"1","_version":2,"result":"updated","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":3,"_primary_term":1,"status":200}}]}

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}