"Elasticsearch API 묶음처리 bulk"의 두 판 사이의 차이

(새 문서: ==개요== ;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...)
 
34번째 줄: 34번째 줄:


[[분류: Elasticsearch API]]
[[분류: Elasticsearch API]]
[[분류: NDJSON]]

2019년 12월 11일 (수) 15:31 판

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 }}