Riak 搜索给我“未找到”可用数据错误

发布于 2024-12-28 23:04:36 字数 1092 浏览 0 评论 0原文

我已经在 Ubuntu Natty 上安装了 Riak 1.0.2。

我还在数据库中添加了一些示例数据。我使用 LevelDB 后端是因为我想测试二级索引功能。

我添加了一个 test_1 存储桶。我向该存储桶添加了以下信息。

array("name" => "Ray_6", "age" => rand(25, 90), "email" => "[email protected]") with key "id_1"
array("name" => "Ray_7", "age" => rand(25, 90), "email" => "[email protected]") with key "id_2"
array("name" => "Ray_8", "age" => rand(25, 90), "email" => "[email protected]") with key "id_3"

我正在尝试使用搜索功能来查询此数据。以下是我在命令行中输入的 CURL 请求:

curl http://localhost:8098/solr/test_1/select?q=name:Ray_6

但是当我执行此操作时,我收到“未找到”错误。

我有什么遗漏的吗?我是否应该对存储桶做一些事情以使其可搜索?

我希望得到一些帮助。

提前致谢。

I've installed Riak 1.0.2 on Ubuntu Natty.

I have also added some sample data to the database. I'm using a LevelDB backend because I want to test the Secondary Indexing functionality.

I added a test_1 bucket. And to that bucket I added the following information.

array("name" => "Ray_6", "age" => rand(25, 90), "email" => "[email protected]") with key "id_1"
array("name" => "Ray_7", "age" => rand(25, 90), "email" => "[email protected]") with key "id_2"
array("name" => "Ray_8", "age" => rand(25, 90), "email" => "[email protected]") with key "id_3"

I'm trying to use the Search feature to query this data. Below is the CURL request that I enter into the command line:

curl http://localhost:8098/solr/test_1/select?q=name:Ray_6

But when I do this, I get a no found error.

Is there something I'm missing? Am I supposed to do something to the bucket to make it searchable?

I'd appreciate some assistance.

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

溺孤伤于心 2025-01-04 23:04:36

嗯,首先,上面的 URL 使用的是 Riak Search,而不是二级索引。查询二级索引的URL形式为:

/buckets/<bucket>/index/<fieldname_bin>/query

通过cURL接口创建记录时,添加元数据头,形成二级索引。不同语言的客户端库将为您生成此内容。

不过,回到你的具体问题。您是否使用 search-cmd 工具为 test_1 存储桶安装索引?如果您这样做了,那么在这样做之前您的存储桶中是否有数据? Riak Search 不会追溯索引您的数据。有几种方法可以做到这一点,但如果这只是一个实验性应用程序,那么这两种方法都很耗时。

如果你的数据不多,建议你设置好索引后重新输入。否则,您需要在读/写一条数据时添加二级索引或通过搜索API进行处理。这需要时间,但现在可以通过 Riak 获得。

希望这有帮助。

Well, firstly, the above URL is using Riak Search and not the secondary indexes. The URL to query a secondary index is in the form of:

/buckets/<bucket>/index/<fieldname_bin>/query

You form a secondary index by adding metadata headers when creating a record through the cURL interface. Client libraries for different languages will generate this for you.

Back to your specific question, though. Did you use the search-cmd tool to install an index for the test_1 bucket? If you did, did you have data in the bucket before doing so? Riak Search will not retroactively index your data. There are a few ways available to do so, but both are time-consuming if this is just an experimental app.

If you don't have much data, I suggest you re-enter it after setting up the index. Otherwise, you need to add secondary index or process it through the search API as you read/write a piece of data. It'll take time, but it's what is available through Riak now.

Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文