What I am trying to do is access 2i information from another bucket inside a post commit hook written in erlang.
I have been looking around the Riak docs and as many other places that I can think of and I can't seem to find how to query 2i with the Riak internal erlang client.
I can do a query to 2i with the http interface with:
/buckets/TEST/index/pos_int/1/15
and it returns
{"keys":["set2i"]}
I can create an entry with the following code (loaded into riak):
Robj = riak_object:new(<<"TEST">>, <<"set2i">>, void, "application/json"),
Lst = [{"pos_int", 5}],
Meta = dict:store(<<"index">>,Lst, dict:new()),
I2obj = riak_object:update_metadata(Robj, Meta)
{ok,C} = riak:local_client().
C:put(I2obj).
This works nicely, but the problem I have is with trying to figure out how to do the same query using the native api for riak. The documentation for anything to do with the riak internal client is effectively non existent.
What all I need:
- information on how to do a integer range query
- information on my other 2i query options, in case I need it
Any help is much appreciated.