Secondary Indexes with ProtoBuff

Russell Brown russelldb at
Thu Jan 19 11:01:52 EST 2012

Hi Gal,
Which version of the client are you using?

On 19 Jan 2012, at 08:19, Gal Barnea wrote:

> Hi
> Is there a way to insert 2i fields using the PB Java client?
Yes, if you're using the current 1.0.x version.

The way to do it is to add the indexes to the object you're storing. So if you're storing an IRiakObject then using the builder, or straight on the IRiakObject, just call

    addIndex(name, value);

If you're storing some domain object (using the JSON converter) then you can annotate fields with the @RiakIndex annotation.

There's an example of both in the tests for the client[1][2].



[2] and
> It seems that this is not possible, so I'm wondering what kind of workarounds exists  
> Is this something that can be done in a Post-Commit hook? if so, will inserts still be faster than the HTTP interface?
> Thanks
> Gal
> _______________________________________________
> riak-users mailing list
> riak-users at

More information about the riak-users mailing list