How to setup the search engine
SocialStream supports the use of Sphinx as a search engine.
You must install the Sphinx packet for UNIX:
sudo apt-get install sphinxsearch
In order to work without any problem make sure NOT to set START=yes
in /etc/default/sphinxsearch
. It should be START=no
.
This gem is installed by default when doing bundle update
as it's included in social_stream gemspec.
The first time you want to use Sphinx you should rebuild all the index for you models for Sphinx to use them.
This is achieved by typing rake ts:rebuild
.
If the server doesn't init just type rake ts:start
.
Use rake ts:in
to begin the indexation.
Use rake ts:rebuild
if you have changed or added the define_index
method for any of the models. This rebuilds everything. If you just need to index new elements use rake ts:in
.
Use rake ts:start
and rake ts:stop
to start and stop the sphinx server.
You may want to rebuild the indexes every time your application is deployed, so changes in your code reach the index structure. Add this to your config/deploy.rb
before 'deploy:restart', 'deploy:rebuild_sphinx'
namespace :deploy do
task :rebuild_sphinx do
run "cd #{ release_path } && bundle exec \\"rake ts:rebuild RAILS_ENV=production\\""
end
end
1,sudo apt-get install sphinxsearch
2,rake thinking_sphinx:index or rake ts:index or rake ts:in
3, rake thinking_sphinx:configure or rake ts:conf or rake ts:config
4, rake thinking_sphinx:start or rake ts:start
5,rake thinking_sphinx:stop or rake ts:stop(if you want to stop)
TODO
These settings are located in config/sphinx.yml
, copied by social_stream install generator.
TODO