Alin, 

Those results are to be expected, because indexes are in lexical order. The 
range between "key1" and "key2" will include all keys that start with "key1" 
plus "key2"; "key10", "key1a", "key12" are all in this range.

If you wanted to find 1 and 2 but not 10, you should add leading zeros to the 
numbers. For example, "key1" would instead be "key01" and "key2" would be 
"key02".The range between "key01" and "key02" would not include "key10", but 
keep in mind it will include "key010". 

-- 
Ian Plosker <i...@basho.com (mailto:i...@basho.com)>
Developer Advocate
Basho Technologies, Inc.



On Thursday, January 12, 2012 at 8:36 AM, Alin Popa wrote:

> Hi guys,
> 
> We were using recently the range queries (like in this example: 
> http://comments.gmane.org/gmane.comp.db.riak.user/5995, but no mapreduce). If 
> doing exactly that example, the return values are what I've expected:  
> 
> curl -X GET "http://127.0.0.1:8198/buckets/range-bucket/index/\$key/key1/key2";
> {"keys":["key2","key1"]}
> 
> BUT
> 
> when adding more objects than ten (first key is 'key0', last key is 'key10') 
> and running the query (exactly the same query as above), I'm getting back: 
> {"keys":["key10","key2","key1"]}
> 
> curl -X GET "http://127.0.0.1:8198/buckets/test-bucket/keys?keys=true"; 
> {"keys":["key7","key0","key8","key4","key2","key10","key3","key9","key6","key1","key5"]}
> 
> What's happening there, as it doesn't seems to return what I would expect ? 
> Am I missing something ? There is some wiki page where I can find more 
> details on these range queries ?
> 
> Thanks,
> Alin
> 
> _______________________________________________
> riak-users mailing list
> riak-users@lists.basho.com (mailto:riak-users@lists.basho.com)
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
> 
> 


_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to