Install thinking Sphinx in Ubuntu 13.04 and set up in Rails 3.2

Check sphinx is already installed in your system,

$ search 

If you have already sphinx installed then it will show the sphinx version and other info, else it shows ubuntu information to install.

Download thinking sphinx from
here,

$ tar -xzf sphinx-2.0.8-release.tar.gz
$ cd sphinx-2.0.8-release/
$ ./configure
$ make
$ sudo make install

Type,

$ search 

it will show the sphinx release and the other information.
Add the sphinx gem into your Gemfile

gem 'thinking-sphinx'

Do bundle install

$ bundle install

I assume you already made the model / controller code for sphinx. Else see this
Index all your records

$ rake ts:index -t

While indexing sphinx will generate the configuration file inside RAILS_ROOT/config/config/development.sphinx.conf

If you need to generate only configuration file not indexing you can use this command

$ rake ts:configure -t

Run sphinx searchd daemon

$ rake ts:start -t

You can stop sphinx searchd daemon

$ rake ts:stop -t

You can reindex so that sphinx will re index all records without creating a configuration file.

$ rake ts:reindex -t

Enjoy Sphinx searching!

Advertisements

Author: Abhilash

Hi, this is Abhilash - Senior Programmer Analyst at CoMakeIT, specialised on web programming. Mainly working on Ruby On Rails platform since 2010.

One thought on “Install thinking Sphinx in Ubuntu 13.04 and set up in Rails 3.2”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s