Created
February 8, 2013 15:06
-
-
Save clr/4739554 to your computer and use it in GitHub Desktop.
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 -X PUT http://127.0.0.1:8091/buckets/statefarm_2i/keys/apple \ | |
-H 'x-riak-index-category_bin: fruit' \ | |
-H 'Content-Type: text/plain' \ | |
-d 'malus domestica' | |
curl -X PUT http://127.0.0.1:8091/buckets/statefarm_2i/keys/banana \ | |
-H 'x-riak-index-category_bin: fruit' \ | |
-H 'Content-Type: text/plain' \ | |
-d 'musa acuminata' | |
curl -X PUT http://127.0.0.1:8091/buckets/statefarm_2i/keys/tomato \ | |
-H 'x-riak-index-category_bin: fruit' \ | |
-H 'x-riak-index-category_bin: vegetable' \ | |
-H 'Content-Type: text/plain' \ | |
-d 'solanum lycopersicum' | |
curl -X PUT http://127.0.0.1:8091/buckets/statefarm_2i/keys/potato \ | |
-H 'x-riak-index-category_bin: vegetable' \ | |
-H 'Content-Type: text/plain' \ | |
-d 'solanum tuberosum' | |
curl http://127.0.0.1:8091/buckets/statefarm_2i/index/category_bin/fruit | |
curl http://127.0.0.1:8091/buckets/statefarm_2i/index/category_bin/vegetable |
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 -X PUT http://127.0.0.1:8091/buckets/statefarm_link/keys/dean \ | |
-H 'Content-Type: text/plain' \ | |
-d 'DevOps' | |
curl -X PUT http://127.0.0.1:8091/buckets/statefarm_link/keys/mark \ | |
-H 'link: </buckets/statefarm_link/keys/dean>; riaktag="friend"' \ | |
-d 'CommunityManager' | |
curl -X PUT http://127.0.0.1:8091/buckets/statefarm_link/keys/casey \ | |
-H 'link: </buckets/statefarm_link/keys/mark>; riaktag="friend"' \ | |
-H 'link: </buckets/statefarm_link/keys/dean>; riaktag="foe"' \ | |
-H 'Content-Type: text/plain' \ | |
-d 'Trainer' | |
curl http://127.0.0.1:8091/buckets/statefarm_link/keys/casey/statefarm_link,foe,1 | |
curl http://127.0.0.1:8091/buckets/statefarm_link/keys/casey/statefarm_link,_,1 | |
curl http://127.0.0.1:8091/buckets/statefarm_link/keys/casey/statefarm_link,friend,0/statefarm_link,_,1 |
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 -X PUT http://127.0.0.1:8091/buckets/statefarm_mr/keys/foo \ | |
-H 'Content-Type: text/plain' \ | |
-d 'pizza data goes here' | |
curl -X PUT http://127.0.0.1:8091/buckets/statefarm_mr/keys/bar \ | |
-H 'Content-Type: text/plain' \ | |
-d 'pizza pizza pizza pizza' | |
curl -X PUT http://127.0.0.1:8091/buckets/statefarm_mr/keys/baz \ | |
-H 'Content-Type: text/plain' \ | |
-d 'nothing to see here' | |
curl -X PUT http://127.0.0.1:8091/buckets/statefarm_mr/keys/bam \ | |
-H 'Content-Type: text/plain' \ | |
-d 'pizza pizza pizza' | |
curl -X POST http://127.0.0.1:8091/mapred \ | |
-H 'Content-Type: application/json' \ | |
-d '{ | |
"inputs":"statefarm_mr", | |
"query":[{"map":{"language":"javascript", | |
"source":"function(riakObject) { | |
var m = riakObject.values[0].data.match(/pizza/g); | |
return [[riakObject.key, (m ? m.length : 0 )]]; | |
}"}}]}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment