Skip to content

Instantly share code, notes, and snippets.

@ianAndrewClark
Created November 16, 2011 11:42
Show Gist options
  • Save ianAndrewClark/1369898 to your computer and use it in GitHub Desktop.
Save ianAndrewClark/1369898 to your computer and use it in GitHub Desktop.
external_quiet version test script
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