如何发出 Riak 搜索查询?

发布于 2024-10-06 18:59:09 字数 838 浏览 0 评论 0原文

我已经使用 Riak 大约一个月了,我刚刚发现了 Riak 搜索。 所以我安装了它,并插入了一个非常基本的json文档来测试。

这是我使用的命令:

curl -X PUT http://127.0.0.1:8098/riak/json/test -H "Content-Type: application/json" -d @test.json

其中 test.json 是...

{
     "firstName": "John",
     "lastName": "Smith"    
 }

所以根据 https://wiki.basho.com/display/RIAK/Riak+Search+-+Indexing+and+Querying+Riak+KV+Data 如果我在此存储桶上启用 KV 搜索,那么当我插入 json 文档时,键会自动索引。

我尝试使用搜索实用程序进行搜索。我尝试过

/search-cmd search firstName "John"
/search-cmd search "firstName:John"

,甚至尝试过curl cmd。

http://127.0.0.1:8098/solr/json/select?q=firstName:John

但我得到了 0 个结果。 我到底做错了什么?

I've been using Riak for about a month now, and I just found out about Riak search.
So I installed it, and inserted a very basic json document to test.

Here is the command i used:

curl -X PUT http://127.0.0.1:8098/riak/json/test -H "Content-Type: application/json" -d @test.json

where test.json is...

{
     "firstName": "John",
     "lastName": "Smith"    
 }

So according to https://wiki.basho.com/display/RIAK/Riak+Search+-+Indexing+and+Querying+Riak+KV+Data
if i enabled KV searching on this bucket, then when i insert json document, the keys are automatically indexed.

I tried to do a search by using the search utility. i tried

/search-cmd search firstName "John"
/search-cmd search "firstName:John"

i even tried a curl cmd.

http://127.0.0.1:8098/solr/json/select?q=firstName:John

but i'm getting 0 results for all of them.
what exactly am i doing wrong?

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

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

发布评论

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

评论(1

一张白纸 2024-10-13 18:59:09

您的搜索命令的范围需要限定在“json”索引,因为您提交的文档将在此处建立索引(Riak 搜索/KV 集成使用存储桶名称作为索引名称)。确保在插入文档之前安装索引挂钩。

尝试:

search-cmd search json firstName:John

为了更快速地回复您的问题,请加入riak-users邮件列表,网址为lists.basho.com

Your search command needs to be scoped to the "json" index since that's where the document you submitted will be indexed (the Riak Search / KV integration uses the bucket name as the index name). Make sure you install the indexing hook before you insert the document.

Try:

search-cmd search json firstName:John

For a more rapid reply to your question, join the riak-users mailing list at lists.basho.com.

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