Riak Search.

Chris Cook cookchrisd at gmail.com
Thu Dec 1 06:29:01 EST 2011


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]

Eshell V5.8.3  (abort with ^G)
1> [ ok = application:start(A) || A <- [sasl, ibrowse] ],
1> IP = "",
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 ----

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>},
3> PropList = [{<<"id">>, <<"123456789">>},{<<"title">>, <<"The Title">>},
{<<"content">>, <<"The Content">>}].
 {<<"title">>,<<"The Title">>},
 {<<"content">>,<<"The Content">>}]
4> Obj = riakc_obj:new("my_books", <<"123456789">>, PropList,

            {<<"title">>,<<"The Title">>},
            {<<"content">>,<<"The Content">>}]}
5> rhc:put(C, Obj).
6> rhc:search(C, "my_books", <<"content:The Content">>).
7> rhc:search(C, <<"my_books">>, <<"content:The Content">>).
8> {ok, Obj0} = rhc:get(C, <<"123456789">>).
** exception error: undefined function rhc:get/2
9> {ok, Obj0} = rhc:get(C, "my_books", <<"123456789">>).

It's probably something to do with the content type, but I'm really unsure,
many thanks in advance Chris.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20111201/95efab02/attachment-0001.html>

More information about the riak-users mailing list