Problem with keys filter in erlang pb client

Dimitry D legato.di at
Sun Jul 24 16:04:22 EDT 2011


I totally lost my mind with this, but I have to finish it.

I have simple app: it extracts data from txt file (data like "timestamp
 value"), push it to Riak and make some range queries.
The problem is when I make key filter query I get *{error,disconnected}*.
I strore data in riak in this way: key – timestamp (like 0.43), value –
value (like 1.14), bucket – time of adding data (like
Here's the code of request:


handle_call({range_query, Bucket, From, To}, _, #state{db_pid = Pid} = State)

Query = [{map,     %query type

  {modfun, riak_kv_mapreduce, map_object_value},  %function from riak erlang
built-in module

  none, true}],

Inputs = {Bucket, [["between", 0, 1]]},

Result = riakc_pb_socket:mapred(Pid, Inputs, Query),

{reply, Result, State};


   range_request(Pid) ->

Bucket = <<"2011-07-24-23-39-45">>,

Result = gen_server:call(Pid, {range_query, Bucket, 0, 1}),


You can find my code in github –

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list