安装sphinxSE 小结

1.软件
mysql-5.1.55.tar.gz
sphinx-for-chinese-1.10.1-dev-r2287.tar.gz
yum install automake libtool readline

2.安装
tar -zxpf mysql-5.1.55.tar.gz
tar -zxpf sphinx-for-chinese-1.10.1-dev-r2287.tar.gz

cp -R sphinx-for-chinese-1.10.1-dev-r2287/mysqlse/* mysql-5.1.55/storage/sphinx
cd mysql-5.1.55
BUILD/autorun.sh
./configure --prefix=/usr/local/mysql --with-ssl --with-plugins=all --with-charset=utf8
make
make install

安装完成后
cd /usr/local/mysql
cp /mysoft/mysql-5.1.55/support-files/my-innodb-heavy-4G.cnf /etc/my.cnf
groupadd mysql
useradd -g mysql mysql
chown -R mysql .
chgrp -R mysql .
bin/mysql_install_db --user=mysql
chown -R root .
chown -R mysql var
bin/mysqld_safe --user=mysql &

bin/mysql -u root

show plugins;
show plugins;
+------------+----------+----------------+---------+---------+
| Name       | Status   | Type           | Library | License |
+------------+----------+----------------+---------+---------+
| binlog     | ACTIVE   | STORAGE ENGINE | NULL    | GPL     |
| partition  | ACTIVE   | STORAGE ENGINE | NULL    | GPL     |
| ARCHIVE    | ACTIVE   | STORAGE ENGINE | NULL    | GPL     |
| BLACKHOLE  | ACTIVE   | STORAGE ENGINE | NULL    | GPL     |
| CSV        | ACTIVE   | STORAGE ENGINE | NULL    | GPL     |
| FEDERATED  | DISABLED | STORAGE ENGINE | NULL    | GPL     |
| MEMORY     | ACTIVE   | STORAGE ENGINE | NULL    | GPL     |
| InnoDB     | ACTIVE   | STORAGE ENGINE | NULL    | GPL     |
| MRG_MYISAM | ACTIVE   | STORAGE ENGINE | NULL    | GPL     |
| MyISAM     | ACTIVE   | STORAGE ENGINE | NULL    | GPL     |
| ndbcluster | DISABLED | STORAGE ENGINE | NULL    | GPL     |
| SPHINX     | ACTIVE   | STORAGE ENGINE | NULL    | GPL     |
+------------+----------+----------------+---------+---------+

CREATE TABLE `sphinx_product` (
`id` bigint(20) unsigned NOT NULL,
`weight` int(11) NOT NULL,
`query` varchar(255) NOT NULL,
`CATALOGID` int(11) NOT NULL,
`EDITUSERID` int(11) NOT NULL,
`HITS` int(11) DEFAULT NULL,
`add_time` int(11) NOT NULL,
KEY `Query` (`query`)
) ENGINE=SPHINX DEFAULT CHARSET=utf8 CONNECTION='sphinx://localhost:9312/product';

SELECT * FROM sphinx_product WHERE query='手机;mode=any;limit=10000' limit 10;

获得SVN版sphinx:
# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://sphinxsearch.googlecode.com/svn/trunk/ sphinxsearch-read-only

================================================
(从mysqlse r2917版开始就加入了string支持,无需打此补丁,可以用svn版本的mysqlse进行sphinxse的安装,coreseek-4.1自带的mysqlse就是r2917,支持string属性字段)
 
svn log mysqlse 
r2917 | tomat | 2011-08-17 20:43:17 +0800 (Wed, 2011-08-17) | 2 行
added STRING attribute to SphinxSE
set up search version to 0x117
如果你需要用中文分词,可能用r2917版的mysqlse安装好sphinxse ,来使用coreseek-4.1-beta.tar.gz版本里的sphinx 2.0.2。
================================================

Support string attr's patch 🙁 SphinxSE 支持string属性补丁)

下面是对string attr属性的补丁

co 出sphinx 的当前版本,再下载以下对应的patch版本补丁

发表评论

电子邮件地址不会被公开。 必填项已用*标注