Sphinx是一个非常快的搜索引擎,提供了非常好的搜索接口,
Thinking Sphinx(A Ruby connector between Sphinx and ActiveRecord)是一个非常容易使用的链接ActiveRecord到Sphinx服务器的ruby库,用来管理Sphinx配置与搜索的ruby接口.

用Sphinx,无限快!!!

首先安装Sphinx:

[root@li96-10 sphinx-0.9.9]# wget http://www.sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz
[root@li96-10 sphinx-0.9.9]# tar zxvf sphinx-0.9.9.tar.gz
[root@li96-10 sphinx-0.9.9]# cd sphinx-0.9.9
[root@li96-10 sphinx-0.9.9]# ./configure --prefix=/usr/local/system/sphinx

报错了:

ERROR: cannot find MySQL include files.

Check that you do have MySQL include files installed.
The package name is typically 'mysql-devel'.

If include files are installed on your system, but you are still getting
this message, you should do one of the following:

1) either specify includes location explicitly, using --with-mysql-includes;
2) or specify MySQL installation root location explicitly, using --with-mysql;
3) or make sure that the path to 'mysql_config' program is listed in
   your PATH environment variable.

To disable MySQL support, use --without-mysql option.

其实还是比较明显的,需要安装mysql-devel

[root@li96-10 sphinx-0.9.9]# yum install mysql-devel
[root@li96-10 sphinx-0.9.9]# ./configure --prefix=/usr/local/system/sphinx
[root@li96-10 sphinx-0.9.9]# make && make install
[root@li96-10 sphinx-0.9.9]# gem install thinking-sphinx #然后安装thinking-sphinx