Created
November 16, 2011 11:42
-
-
Save ianAndrewClark/1369898 to your computer and use it in GitHub Desktop.
external_quiet version test script
This file contains hidden or 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 -X DELETE "http://localhost:9200/dashboard" | |
curl -X POST "http://localhost:9200/dashboard/article/1?version=15&version_type=external_quiet" -d ' | |
{ "title" : "One", | |
"tags" : ["ruby", "java", "search"]} | |
' | |
#{"ok":true,"_index":"dashboard","_type":"article","_id":"1","_version":15} | |
curl -X POST "http://localhost:9200/dashboard/article/1?version=13&version_type=external_quiet" -d ' | |
{ "title" : "Two", | |
"tags" : ["java", "search"] } | |
' | |
#with this change returns {"ok":true,"_index":"dashboard","_type":"article","_id":"1","_version":15} | |
#before this change and with version_type=external return {"error":"VersionConflictEngineException[[dashboard][2] [article][1]: version conflict, current [15], required [13]]","status":409} | |
curl -X GET "http://localhost:9200/dashboard/article/1" | |
#returns the version 15.... nothing happened in the second index operation | |
#{"_index":"dashboard","_type":"article","_id":"1","_version":15,"exists":true, "_source" : | |
# { "title" : "One", | |
# "tags" : ["ruby", "java", "search"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment