Skip to content

Instantly share code, notes, and snippets.

@drewkerrigan
Created December 5, 2012 18:31
Show Gist options
  • Save drewkerrigan/4218222 to your computer and use it in GitHub Desktop.
Save drewkerrigan/4218222 to your computer and use it in GitHub Desktop.
php multi-get mapred
require("riak-php-client/riak.php");
$client = new RiakClient('127.0.0.1', 8098);
$mr = new RiakMapReduce($client);
$keys = array("TFrWAVz8RRVEEqCH3nS27O4InLB","FEwZgNI4VTJSIZxSas0QpOCCXjn","EkSkmblyIAT5VL7xYpScP2GP71G");
foreach ($keys as $key) {
$mr->add("local_ns~users", $key);
}
$mr->map("Riak.mapValues");
$res = $mr->run();
var_dump($res);
@georgepsarakis
Copy link

Thanks for sharing this solution! Do you know if this is guaranteed to return results in the order given in the $keys array? My tests show that this is the case, but it would be great if you could confirm it too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment