如何发出 Riak 搜索查询?
我已经使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的搜索命令的范围需要限定在“json”索引,因为您提交的文档将在此处建立索引(Riak 搜索/KV 集成使用存储桶名称作为索引名称)。确保在插入文档之前安装索引挂钩。
尝试:
为了更快速地回复您的问题,请加入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:
For a more rapid reply to your question, join the riak-users mailing list at lists.basho.com.