【问题标题】:Riak search returns nullRiak 搜索返回 null
【发布时间】:2013-03-28 13:43:46
【问题描述】:

我正在尝试在 PHP 上使用 Riak。我阅读了文档,但没有运气。所以我已经将 /etc/init.d/app.conf 中的“搜索”选项配置为 true。所以,print_r($results) 返回为空数组。

# Connect to Riak
$client = new RiakClient('127.0.0.1', 8098);

$bucket = $client->bucket("searchbucket");
$bucket->newObject("one", array("foo"=>"one", "bar"=>"red"))->store();
$bucket->newObject("two", array("foo"=>"two", "bar"=>"green"))->store();

# Execute a search for all objects with matching properties
$results = $client->search("searchbucket", "foo:one OR foo:two")->run();


print_r($results);

我的代码有什么问题?我误解了什么?

【问题讨论】:

    标签: php nosql riak riak-search


    【解决方案1】:

    除了在 app.config 文件中启用搜索之外,您还需要为您希望能够搜索的存储桶显式启用它。这可以通过adding a Riak Search commit hook to the bucket properties. 完成

    如果您检索“searchbucket”的bucket properties,您应该能够看到列出的提交挂钩。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-02-13
      • 2019-10-13
      • 1970-01-01
      • 1970-01-01
      • 2019-10-11
      • 1970-01-01
      相关资源
      最近更新 更多