Created
October 28, 2013 15:10
-
-
Save jprante/7198497 to your computer and use it in GitHub Desktop.
Bulk updates do not conflict, ignore doc versioning
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -XDELETE 'localhost:9200/test' | |
curl 'localhost:9200/test/_refresh' | |
curl -XPUT 'localhost:9200/test' | |
curl -XPOST 'localhost:9200/_bulk' -d ' | |
{ "index" : { "_index" : "test", "_type" : "doc", "_id" : "1" } } | |
{ "field1" : "value1"} | |
' | |
curl 'localhost:9200/test/_refresh' | |
# no conflict! | |
curl -XPOST 'localhost:9200/_bulk' -d ' | |
{ "update" : { "_index" : "test", "_type" : "doc", "_id" : "1", "_version" : 1 } } | |
{ "doc" : { "field2" : "value2" } } | |
' | |
curl 'localhost:9200/test/_refresh' | |
# no conflict! | |
curl -XPOST 'localhost:9200/_bulk' -d ' | |
{ "update" : { "_index" : "test", "_type" : "doc", "_id" : "1", "_version" : 1 } } | |
{ "doc" : { "field3" : "value3" } } | |
' | |
curl 'localhost:9200/test/_refresh' | |
curl 'localhost:9200/test/doc/1' | |
# --> {"field1":"value1","field2":"value2","field3":"value3"} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment