Retrieve all keys of an index?

Jeff Peck jeffp at tnrglobal.com
Tue Apr 9 21:54:02 EDT 2013


Hello,

In Riak, is it possible to retrieve all of the keys of an index? I do not want the object keys in this case, but rather the actual index keys.

I am not sure that I am using the correct terminology, but to illustrate, consider a Riak bucket with the following objects, where "catalog" is indexed to "catalog_bin":

{'url':'http://www.google.com', 'catalog':'1001'}
{'url':'http://www.yahoo.com', 'catalog':'1001'}
{'url':'http://www.blah.com', 'catalog': 1002'}
{'url':'http://www.test123.com', 'catalog': 1002'}
{'url':'http://www.test12345.com', 'catalog': 1003'}

I would like to retrieve all of the keys for the index catalog_bin. From the above example, that would be:
1001
1002
1003

To illustrate further, it would be the equivalent of the following in MySQL, if the above data were to be in a table called "urls":

	SELECT catalog FROM urls GROUP BY catalog;

I would appreciate any advice as to how to query for this in Riak, or if this not feasible, then perhaps a suggestion for the best way to organize the data.

Thank you,
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20130409/03b8aafe/attachment.html>


More information about the riak-users mailing list