Well, that's what I had been trying to do: delete all the objects
in the bucket and re-insert again.
So now, I can't delete the objects, and there's no delete-bucket
operation. Is that supposed to mean that I have to delete the
entire Riack db and start everything from scratch??? I hope I
got that part wrong.
Best
Xiaopong
On Wed, 2010-12-15 at 22:50 +0800, Joseph Lambert wrote:
> 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
>
> [email protected]
>
>
> On Wed, Dec 15, 2010 at 7:12 PM, Xiaopong Tran
> <[email protected]> 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
> [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