upserting batches into elasticsearch store with bulk API -


i have huge set of documents same index , same type different ids. want either update existing ones or insert new in batches. how can achieve using bulk indexing api? want below throws error. basically, want upsert multiple docs in batches have same index , same type.

curl -s -h "content-type: application/json" -xpost localhost:9200/_bulk -d' { "index": {"_type": "sometype", "_index": "someindex"}} { "_id": "existing_id", "field1": "test1"} { "_id": "existing_id2", "field2": "test2"} ' 

you need this:

curl -s -h "content-type: application/json" -xpost localhost:9200/someindex/sometype/_bulk -d' { "index": {"_id": "existing_id"}} { "field1": "test1"} { "index": {"_id": "existing_id2"}} { "field2": "test2"} ' 

since documents in same index/type, move url , specify _id each document want update in bulk.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -