fetch all data after index query

Alexey Loshkarev elf2001 at gmail.com
Thu May 10 08:51:24 EDT 2012


Hello.
I'm novice in Riak, so my question may be stupid :)

I'm using riak to store access.log data. I created secondary index on log date.
Then I want to use it in my django-application.

I'm using official riak-python client
(http://basho.github.com/riak-python-client/) to access data.

One of the usecases - display logs for specified date (or date range).

My code:

[r.get().get_data() for r in
riak.mapreduce.RiakMapReduce(client).add('logs.api').index('logs.api',
'date_bin', '20120508134300').run()]

But it send get-request for every entry after run(). So, if I have 100
rows after run(), python would do 100 GET-requests.

How to avoid it?

Am I missed some arguments to index/run function?
Or can I get multiple items with one query?

Thanks


-- 
----------------
Best regards
Alexey Loshkarev
mailto:elf2001 at gmail.com




More information about the riak-users mailing list