Skip to content

Instantly share code, notes, and snippets.

@imotov
Created January 3, 2013 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imotov/b01e8706948d2bd2c943 to your computer and use it in GitHub Desktop.
Save imotov/b01e8706948d2bd2c943 to your computer and use it in GitHub Desktop.
curl -XDELETE localhost:9200/my_proto
echo
curl -XPUT localhost:9200/my_proto -d '{
"mappings": {
"some_type": {
},
"chow-clfg": {
"_parent": {
"type": "some_type"
}
}
}
}'
echo
curl -XPUT 'localhost:9200/my_proto/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw?parent=12345' -d '{
"chow-clfg": {
"count": 1
}
}'
echo
curl -XPOST 'localhost:9200/my_proto/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw/_update?parent=12345' -d '{
"script":"ctx._source[\"chow-clfg\"].count+=num",
"params":{"num":1}
}'
echo
curl -XGET 'localhost:9200/my_proto/chow-clfg/Nx4JcvyxTPujkyy0Jq5BNw?routing=12345&pretty=true'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment