Modify your Riak app.config
By default, Riak Search is disabled. You can enable it in the app.config on each Riak server by changing the value from false to true. The config section should then look something like this:
%% Riak Search Config {riak_search,[ %% To enable Search functionality set this 'true'. {enabled, true} ]},
Don't forget to restart Riak afterwards.
Enable the commit hook
From the Rails console you can enable the commit hook for the model you would like to make searchable. Keep in mind anything created prior to doing this will not be searchable. You will need to go back afterwards and essentially touch each of those objects.
MyObject.bucket.enable_index!Just replace MyObject with class you wish to make searchable.
Search!
Ripple.client.search MyObject.bucket.name, "some_field:query"
Matt, are you able to execute searches in test mode? I have search working in the rails console in development mode, but test mode fails.
ReplyDeleteYes, but I ripped out the Test Riak server setup that was there and setup a separate test cluster.
DeleteI actually have some rake tests for generating the config and joining the nodes that I need to share. Look for those soon!
Hey Mat thanks for the link back :)
ReplyDeleteNo problem, thanks for writing up a nice post about Riak Search. It's tough to find good info on it. I'm actually writing a gem to wrap up the search functionality. I already have some good baseline functionality built in. Check it out! Would love to hear your thoughts on it.
Deletehttps://github.com/validas/Ripplr
That seems awesome, but i no longer use raik, I will definitely check this out when I use riak again. cheers
DeleteTop 10 Reasons Why Baccarat Is Better than Three Card Poker
ReplyDeleteLearn why baccarat is the best way to bet. 바카라 사이트 The main 샌즈카지노 reason why this game is popular is because of the combination of choegocasino two betting outcomes