Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- curl -XPOST 'localhost:9200/_bulk?pretty' -H 'Content-Type: application/json' -d '
- { "index" : { "_index" : "test", "_type" : "type1", "_id" : "1" } }
- { "field1" : "value1" }
- { "delete" : { "_index" : "test", "_type" : "type1", "_id" : "2" } }
- { "create" : { "_index" : "test", "_type" : "type1", "_id" : "3" } }
- { "field1" : "value3" }
- { "update" : {"_id" : "1", "_type" : "type1", "_index" : "test"} }
- { "doc" : {"field2" : "value2"} }
- '
- import requests
- import json
- data = json.dumps({"field":"value"})
- r = requests.post("localhost:9200/_bulk?pretty", data=data)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement