Joseph Lambert joseph.g.lambert at gmail.com
Wed Dec 15 09:50:05 EST 2010

You need to add the hook before you add the objects you want indexed when
inserting KV data. The precommit hook is what triggers the indexing of the
objects. If it's not installed when you insert an object, it's not going to
index it.

>From the wiki:

"Riak Search indexing of KV data must be enabled on a per-KV-bucket basis.
To enable indexing for a bucket, simply add the Search precommit hook to
that bucket's properties"

"With the precommit hook installed, Riak Search will index your data each
time that data is written"

I believe the delete is failing because it can't find the value in the
index, so the precommit hook returns {precommit_fail,notfound} error (since
a delete updates the meta data of the object).

If you want to see index data, the index buckets start are named like _rsid_
*bucketname*, where bucketname is the bucket you install the hook on.

- Joe Lambert

joseph.g.lambert at gmail.com

On Wed, Dec 15, 2010 at 7:12 PM, Xiaopong Tran <xiaopong.tran at gmail.com>wrote:

> I installed Riak Search, added a few JSON docs, then install the
> search hook for the bucket. Now, here are the questions:
> 1) How can I list the indexes that have been created
> for my bucket?
> 2) After installing the hook, I can't delete my object
> anymore. Here is the error:
> 7> {ok, P} = test3:init().
> {ok,<0.44.0>}
> 8> riakc_pb_socket:get(P, "user_bucket", "jane").
> {ok,{riakc_obj,"user_bucket","jane",
> <<107,206,97,96,96,96,204,96,202,5,82,44,108,85,66,103,50,
>                 152,18,25,243,88,25,...>>,
>               [{{dict,3,16,16,8,80,48,
>                       {[],[],[],[],[],[],[],[],[],[],[],[],...},
>                       {{[],[],[],[],[],[],[],[],[],[],...}}},
>                 <<"{\"userid\":\"jane\",\"first_name\":\"Jane\",
> \"last_name\":\"Doe\",\"gender\":\"F\",\"joined_"...>>}],
>               undefined,undefined}}
> 9> riakc_pb_socket:delete(P, "user_bucket", "jane").
> {error,<<"{precommit_fail,notfound}">>}
> 10> riakc_pb_socket:delete(P, "user_bucket", <<"jane">>).
> {error,<<"{precommit_fail,notfound}">>}
> I can retrieve the object, but can't delete it. What's is going on?
> Thanks
> Xiaopong
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20101215/b874a5d5/attachment.html>

More information about the riak-users mailing list