Hi Markus,

With Riak 1.4, 2i results are sorted in ascending order. So a range query from 0 to 99999999 or 99999999 to 0 with a max result of 1 will always return the lowest index value. In your case you may want to store the largest key # somewhere, or if you need to find it infrequently you may also try a map reduce job.  

How often will you need to know this max key?

Thanks,
Alex Moore

On September 18, 2013 at 5:56:22 AM, Markus Doppelbauer (doppelba...@gmx.net) wrote:

Hello,

Is there a chance to get the biggest key of a bucket or secondary index?
E.g.: A bucket (or 2i) contains the keys: 10, 20, 30, 40, 50
The result should be: 50
 
Could this problem be solved, by quering a secondary index from back, e.g.:
curl http://localhost:8098/buckets/mybucket/index/field_int/99999999999/0?max_results=1
 
Thanks a lot
Markus
 
 
_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to