Created
July 25, 2011 16:37
-
-
Save kellymclaughlin/1104530 to your computer and use it in GitHub Desktop.
2I test queries
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
# Index some documents... | |
curl -v -X PUT \ | |
-d 'data1' \ | |
-H "Content-Type: application/json" \ | |
-H "x-riak-index-field1_bin: val1" \ | |
-H "x-riak-index-field2_int: 1001" \ | |
http://127.0.0.1:8098/riak/mybucket/mykey1 | |
curl -v -X PUT \ | |
-d 'data2' \ | |
-H "Content-Type: application/json" \ | |
-H "x-riak-index-Field1_bin: val2" \ | |
-H "x-riak-index-Field2_int: 1002" \ | |
http://127.0.0.1:8098/riak/mybucket/mykey2 | |
curl -v -X PUT \ | |
-d 'data3' \ | |
-H "Content-Type: application/json" \ | |
-H "X-RIAK-INDEX-FIELD1_BIN: val3" \ | |
-H "X-RIAK-INDEX-FIELD2_INT: 1003" \ | |
http://127.0.0.1:8098/riak/mybucket/mykey3 | |
curl -v -X PUT \ | |
-d 'data4' \ | |
-H "Content-Type: application/json" \ | |
-H "x-riak-index-field1_bin: val4" \ | |
-H "x-riak-index-field2_int: 1004" \ | |
http://127.0.0.1:8098/riak/mybucket/mykey4 | |
# Retrieve the documents... | |
curl -i http://127.0.0.1:8098/riak/mybucket/mykey1 | |
curl -i http://127.0.0.1:8098/riak/mybucket/mykey2 | |
curl -i http://127.0.0.1:8098/riak/mybucket/mykey3 | |
curl -i http://127.0.0.1:8098/riak/mybucket/mykey4 | |
# Query against a binary field... | |
curl http://localhost:8098/buckets/mybucket/index/field1_bin/val1 | |
curl http://localhost:8098/buckets/mybucket/index/field1_bin/val2 | |
curl http://localhost:8098/buckets/mybucket/index/field1_bin/val2/val4 | |
# Query against an integer field... | |
curl http://localhost:8098/buckets/mybucket/index/field2_int/1001 | |
curl http://localhost:8098/buckets/mybucket/index/field2_int/1002 | |
curl http://localhost:8098/buckets/mybucket/index/field2_int/1002/1004 | |
# Query against the speciel fields $bucket and $key | |
curl http://localhost:8098/buckets/mybucket/index/\$bucket/mybucket | |
curl http://localhost:8098/buckets/mybucket/index/\$key/mykey2/mykey3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment