So finally got a chance to try this and I am running into issues (I am on Riak 2.0pre7) btw.
I have yz turned on: http://192.168.1.10:8098/yz I created the index with: $ curl -i http://192.168.1.10:8098/yz/index/allLogs HTTP/1.1 200 OK Server: MochiWeb/1.1 WebMachine/1.10.5 (jokes are better explained) Date: Tue, 26 Nov 2013 22:51:15 GMT Content-Type: application/json Content-Length: 41 {"name":"allLogs","schema":"_yz_default"} And associated the search to the bucket probs: http://192.168.1.10:8098/buckets/logs/props { props: { allow_mult: true, basic_quorum: false, big_vclock: 50, chash_keyfun: { mod: "riak_core_util", fun: "chash_std_keyfun" }, dw: "quorum", last_write_wins: false, linkfun: { mod: "riak_kv_wm_link_walker", fun: "mapreduce_linkfun" }, n_val: 3, name: "logs", notfound_ok: true, old_vclock: 86400, postcommit: [ ], pr: 0, precommit: [ ], pw: 0, r: "quorum", rw: "quorum", small_vclock: 50, w: "quorum", young_vclock: 20, yz_index: "allLogs" } } I put in a text/plain entry with: http://192.168.1.10:8098/riak/logs/26-11-2013T2260?vtag=47ffPuWSln7VhlTl02raJA [2013-11-26T22:43:26] [ERROR] [192.168.1.102] [0] [thakore.kar...@gmail.com] test http://192.168.1.10:8098/riak/logs/26-11-2013T2260?vtag=6IYwwPE27eUbs8ThaSOcTC [2013-11-26T22:39:59] [ERROR] [192.168.1.102] [0] [thakore.kar...@gmail.com] test But when I search: http://192.168.1.10:8098/search/allLogs?q=* No results http://192.168.1.10:8098/search/allLogs?q=test No results Whats going on? On Thu, Nov 21, 2013 at 12:45 PM, Ryan Zezeski <rzeze...@basho.com> wrote: > > > > > On Wed, Nov 20, 2013 at 3:48 PM, Kartik Thakore <kthak...@aimed.cc> wrote: >> >> Thank you. >> >> I am creating indexes with: >> >> curl -i -XPUT http://192.168.1.10:8098/yz/index/allLogs \ >> -H 'content-type: application/json' \ >> -d '{"schema" : "_yz_default", "bucket" : "logs" }' >> >> >> But when I check the index with: >> >> curl -i http://192.168.1.10:8098/yz/index/allLogs >> >> It drops the bucket association >> >> HTTP/1.1 200 OK >> Server: MochiWeb/1.1 WebMachine/1.10.5 (jokes are better explained) >> Date: Wed, 20 Nov 2013 20:45:21 GMT >> Content-Type: application/json >> Content-Length: 41 >> >> {"name":"allLogs","schema":"_yz_default"} > > > Sorry, that documentation is out of date. > > To associate an index to a bucket you need to set the bucket's properties. > > curl -XPUT -H 'content-type: application/json' ' http://localhost:8098/buckets/logs/props' -d '{"props":{"yz_index":"allLogs"}}' > > You can perform a GET on that same resource to check the yz_index property is set. > >> >> Also >> >> what is going on here >> >> curl -XPUT -H'content-type:application/json' http://localhost:8098/buckets/people/keys/me \ >> -d'{ "name_s" : "kartik" }' >> >> Why not: >> curl -XPUT -H'content-type:application/json' http://localhost:8098/rial/people/me \ >> -d'{ "name_s" : "kartik" }' > > > > In Riak 1.0.0 we changed the resource from '/riak/<bucket>/<key>' to '/buckets/<bucket>/keys/<key>'. We were supposed to deprecate and eventually remove the old resource but we never did. You can still use the old style but I would recommend using the new style as it is what we use in official docs and there is a chance perhaps the old resources don't stay up to date with the latest features. > > > -Z
_______________________________________________ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com