Thank you for that, we managed to work around using a precommit hook and making a call directly to the riak search module! But I will be pulling that down and taking a look at doing that as well. Many thanks and keep up the great work on riak!
Chris. Sent from my BlackBerry® wireless device -----Original Message----- From: Ryan Zezeski <[email protected]> Date: Thu, 15 Dec 2011 21:44:38 To: Chris Cook<[email protected]> Cc: <[email protected]> Subject: Re: Riak Search. Hi Chris, Sorry it took so long to respond. I'm going to take a guess that you are using a 1.0.x version of Riak? The problem you're facing is that in 1.0 we changed some things with regard to bucket properties. You are trying to set the Search commit hook manually but that won't work anymore. There are two ways to install the Search hook outside of the client: 1) at the terminal run `search-cmd install my_books` 2) curl -X PUT -H 'Content-Type: application/json' http://localhost:8091/riak/foo -d '{"props": {"search": true} }' I just submitted a PR that will allow you to enable the search hook via riak-erlang-http-client as well. https://github.com/basho/riak-erlang-http-client/pull/6 It allows you to set the hook like so: `rhc:set_bucket(C, "foo2", [{search, true}]).` -Ryan On Thu, Dec 1, 2011 at 6:29 AM, Chris Cook <[email protected]> wrote: > Hi, > > Sorry, but I've done a lot of googling and haven't been to work out where > this is going wrong, could someone please point out where I may be going > wrong with it. I have riak search enabled and set to true and riak clusters > all restarted. I go through the following steps below using > riak-erlang-http-client, but whenever I do a search I get {ok, []} back. > > Erlang R14B02 (erts-5.8.3) [source] [rq:1] [async-threads:0] > [kernel-poll:false] > > Eshell V5.8.3 (abort with ^G) > 1> [ ok = application:start(A) || A <- [sasl, ibrowse] ], > 1> IP = "127.0.0.1", > 1> Port = 8098, > 1> Prefix = "riak", > 1> Options = [], > 1> C = rhc:create(IP, Port, Prefix, Options). > > ---- Snipped Progress Reports from here, everything start with ok ---- > > {rhc,"127.0.0.1",8098,"riak",[{client_id,"At5+Yg=="}]} > 2> rhc:set_bucket(C, "my_books", [{<<"precommit">>, [{struct, [{<<"mod">>, > <<"riak_search_kv_hook">>}, {<<"fun">>,<<"precommit">>}]}]}]). > > =PROGRESS REPORT==== 1-Dec-2011::11:13:43 === > supervisor: {local,inet_gethost_native_sup} > started: > [{pid,<0.53.0>},{mfa,{inet_gethost_native,init,[[]]}}] > > =PROGRESS REPORT==== 1-Dec-2011::11:13:43 === > supervisor: {local,kernel_safe_sup} > started: [{pid,<0.52.0>}, > {name,inet_gethost_native_sup}, > {mfargs,{inet_gethost_native,start_link,[]}}, > {restart_type,temporary}, > {shutdown,1000}, > {child_type,worker}] > ok > 3> PropList = [{<<"id">>, <<"123456789">>},{<<"title">>, <<"The Title">>}, > {<<"content">>, <<"The Content">>}]. > [{<<"id">>,<<"123456789">>}, > {<<"title">>,<<"The Title">>}, > {<<"content">>,<<"The Content">>}] > 4> Obj = riakc_obj:new("my_books", <<"123456789">>, PropList, > list_to_binary("application/x-erlang-term")). > {riakc_obj,"my_books",<<"123456789">>,undefined,[], > {dict,1,16,16,8,80,48, > {[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],...}, > > {{[],[],[],[],[],[],[],[],[],[],[[<<...>>|...]],[],[],...}}}, > [{<<"id">>,<<"123456789">>}, > {<<"title">>,<<"The Title">>}, > {<<"content">>,<<"The Content">>}]} > 5> rhc:put(C, Obj). > ok > 6> rhc:search(C, "my_books", <<"content:The Content">>). > {ok,[]} > 7> rhc:search(C, <<"my_books">>, <<"content:The Content">>). > {ok,[]} > 8> {ok, Obj0} = rhc:get(C, <<"123456789">>). > ** exception error: undefined function rhc:get/2 > 9> {ok, Obj0} = rhc:get(C, "my_books", <<"123456789">>). > {ok,{riakc_obj,"my_books",<<"123456789">>, > <<107,206,97,96,96,96,204,96,202,5,82,28,202,156,255,126, > 250,45,186,178,45,131,41,...>>, > [{{dict,3,16,16,8,80,48, > {[],[],[],[],[],[],[],[],[],[],[],[],...}, > {{[],[],[],[],[],[],[],[],[],[],...}}}, > <<131,108,0,0,0,3,104,2,109,0,0,0,2,105,100,109,0,0,0, > ...>>}], > undefined,undefined}} > 10> > > It's probably something to do with the content type, but I'm really > unsure, many thanks in advance Chris. > > > > > _______________________________________________ > riak-users mailing list > [email protected] > http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com > >
_______________________________________________ riak-users mailing list [email protected] http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
