Can't find docs/tutorial on secondary indexes for riak-erlang-client

Jeremiah Peschka jeremiah.peschka at gmail.com
Sun Mar 11 14:46:52 EDT 2012


Howdy Buri,

I'm not an Erlang expert, or even something remotely resembling competent with Erlang, however, I believe I have tracked down what you're looking for.

You can use one of the riakc_pb_socket:get_index functions to pull back data from an index. If you look at the source on the methods, you'll see that they're just wrappers around a MapReduce call. As far as setting the values... I think you'll have to make a call to riakc_obj:update_metadata and add the index metadata in by hand, but I could be wrong on that one. 

If I'm wrong, hopefully someone on the list will correct my Erlang-y ignorance.

get_index/4 [1]
get_index/5 [3]
get_index/6 [2]
get_index/7 [4]



[1]: https://github.com/basho/riak-erlang-client/blob/master/src/riakc_pb_socket.erl#L677
[2]: https://github.com/basho/riak-erlang-client/blob/master/src/riakc_pb_socket.erl#L695
[3]: https://github.com/basho/riak-erlang-client/blob/master/src/riakc_pb_socket.erl#L714
[4]: https://github.com/basho/riak-erlang-client/blob/master/src/riakc_pb_socket.erl#L732 
---
Jeremiah Peschka - Managing Director, Brent Ozar PLF, LLC
Microsoft SQL Server MVP

On Mar 11, 2012, at 11:06 AM, Buri Arslon wrote:

> Hi everybody,
> 
> I can't find any tutorial or docs on secondary indexes. Here (http://lists.basho.com/pipermail/riak-users_lists.basho.com/2011-October/005952.html) it was stated that the docs would be updated but I can't find it.
> 
> I just wanted a doc which explains how to use secondary indexes with native erlang client. Riak docs have examples for http api but not for erlang client.
> 
> Can anyone refer me to appropriate docs/tutorials?
> 
> Thanks,
> -- Buriwoy
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com





More information about the riak-users mailing list