riak kv search problem

alezozov alezozov at gmail.com
Thu Apr 21 04:23:06 EDT 2011

I'm trying to use auto index of bucket's objects.

First I allow Riak to do it for some bucket

*curl -X PUT
-H "Content-Type: application/json"

then putting some kv record in this bucket

curl -X PUT -H "Content-Type:
text/plain" -d  "here are some words"

but getting error:

*PUT aborted by pre-commit hook.*

i tried a piece of code

require_once 'riak.php';
$client = new Riak();
$bucket = $client->bucket('users');

$user = $bucket->newObject('alezozov3',
'mail'=>'alezozov at mail.ru',

//$aluser = $bucket->get('alezozov');
// if($aluser->getData()){
// print_r($aluser->getData());
// }
// else{
// echo '0';
// }


$results = $client->search("users", "name:alezozov")->run();
echo '-';

but getting message :

*Fatal error: Uncaught exception 'Exception' with message 'Expected status
200 or 201 or 300, received 403' in
/opt/lampp/htdocs/lib/php/riak_lib.php:1206 Stack trace: #0
/opt/lampp/htdocs/lib/php/riak_lib.php(1102): RiakObject->populate(Array,
Array) #1 /opt/lampp/htdocs/test/index.php(15): RiakObject->store() #2
{main} thrown in /opt/lampp/htdocs/lib/php/riak_lib.php on line 1206*

but if I don't use

*url -X PUT
-H "Content-Type: application/json"

everything ok, and I can store and get objects, with command line and php
code, but of cource can't search

what I doing wrong ? where to dig?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110421/4a957020/attachment.html>

More information about the riak-users mailing list