我有一个测试系统,我已经在libraries
bucket type 上创建并激活了一个搜索属性clients
。
➜ riak-2.1.0 curl http://localhost:8098/buckets/coding-with-riak/props
{"props":{"allow_mult":false,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"dvv_enabled":false,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"name":"coding-with-riak","notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit":[],"pw":0,"r":"quorum","rw":"quorum","search_index":"libraries","small_vclock":50,"w":"quorum","write_once":false,"young_vclock":20}}%
➜ riak-2.1.0 bin/riak-admin bucket-type status clients
clients is active
active: true
allow_mult: true
basic_quorum: false
big_vclock: 50
chash_keyfun: {riak_core_util,chash_std_keyfun}
claimant: 'riak@127.0.0.1'
dvv_enabled: true
dw: quorum
last_write_wins: false
linkfun: {modfun,riak_kv_wm_link_walker,mapreduce_linkfun}
n_val: 3
notfound_ok: true
old_vclock: 86400
postcommit: []
pr: 0
precommit: []
pw: 0
r: quorum
rw: quorum
search_index: <<"libraries">>
small_vclock: 50
w: quorum
young_vclock: 20
我相信我设置了桶,coding-with-riak
以使其准备好进行搜索:
➜ ~ curl http://localhost:8098/buckets/coding-with-riak/props
{"props":{"allow_mult":false,"basic_quorum":false,"big_vclock":50,"chash_keyfun":{"mod":"riak_core_util","fun":"chash_std_keyfun"},"dvv_enabled":false,"dw":"quorum","last_write_wins":false,"linkfun":{"mod":"riak_kv_wm_link_walker","fun":"mapreduce_linkfun"},"n_val":3,"name":"coding-with-riak","notfound_ok":true,"old_vclock":86400,"postcommit":[],"pr":0,"precommit":[],"pw":0,"r":"quorum","rw":"quorum","search_index":"libraries","small_vclock":50,"w":"quorum","write_once":false,"young_vclock":20}}%
但是当我尝试通过 Ruby 客户端或 cURL 进行搜索时,它会出错:
>> coding.keys
Riak::Bucket#keys is an expensive operation that should not be used in production.
=> ["ruby", "python", "go"]
>> results = client.search("coding-with-riak", "maintainer_s:*")
Riak::ProtobuffsErrorResponse: Expected success from Riak but received 0. No index <<"coding-with-riak">> found.
cURL 有类似的结果:
➜ curl "http://localhost:8098/search/query/libraries?wt=json&q=popular_b:true"
(23) Failed writing body
我错过了什么?我已经多次浏览了搜索方法,但找不到我缺少的东西。请注意,我在激活搜索属性后确实重新启动了。